Sha256: fb4f80e576dd2fb333ff370d4a8584571e9fe19e5852942bca6ddfe5dad30e78

Contents?: true

Size: 528 Bytes

Versions: 6

Compression:

Stored size: 528 Bytes

Contents

module Minjs
  #
  # 14 Program
  #
  module Program
    def source_elements(lex, context, options = {})
      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

    def source_element(lex, context)
      lex.eval_lit{
        statement(lex, context)
      } or lex.eval_lit{
        func_declaration(lex, context)
      }
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
minjs-0.2.2 lib/minjs/program.rb
minjs-0.2.1 lib/minjs/program.rb
minjs-0.2.0 lib/minjs/program.rb
minjs-0.1.10 lib/minjs/program.rb
minjs-0.1.7 lib/minjs/program.rb
minjs-0.1.5 lib/minjs/program.rb