Module: Minjs::Program
- Included in:
- Compressor
- Defined in:
- lib/minjs/program.rb
Overview
14 Program
Instance Method Summary collapse
- #program(lex, context) ⇒ Object
- #source_element(lex, context) ⇒ Object
- #source_elements(lex, context, options = {}) ⇒ Object
Instance Method Details
#program(lex, context) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/minjs/program.rb', line 6 def program(lex, context) prog = source_elements(@lex, @global_context) if lex.eof? return prog else raise ParseError.new("unexpceted token", lex) end end |
#source_element(lex, context) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/minjs/program.rb', line 23 def source_element(lex, context) #lex.eval_lit{ statement(lex, context) #} or lex.eval_lit{ => statement # func_declaration(lex, context) #} end |