Module: Minjs::Program
- Included in:
- Compressor
- Defined in:
- lib/minjs/program.rb
Overview
14 Program
Instance Method Summary collapse
Instance Method Details
#source_element(lex, context) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/minjs/program.rb', line 19 def source_element(lex, context) lex.eval_lit{ statement(lex, context) } or lex.eval_lit{ func_declaration(lex, context) } end |
#source_elements(lex, context, options = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/minjs/program.rb', line 6 def source_elements(lex, context, = {}) prog = [] while !lex.eof? t = source_element(lex, context) if t prog.push(t) else break end end ECMA262::Prog.new(context, ECMA262::SourceElements.new(prog)) end |