Skip to content

Commit

Permalink
Seperate grammar(parser) and lexer into 2 classes
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Oct 24, 2013
1 parent e6d2a7d commit 689a501
Show file tree
Hide file tree
Showing 7 changed files with 154 additions and 145 deletions.
7 changes: 3 additions & 4 deletions lib/opal/compiler.rb
@@ -1,10 +1,9 @@
require 'opal/lexer'
require 'opal/grammar'
require 'set'
require 'opal/parser'
require 'opal/target_scope'
require 'opal/version'
require 'opal/fragment'
require 'opal/nodes'
require 'set'

module Opal
class Compiler
Expand Down Expand Up @@ -71,7 +70,7 @@ def compile(source, options = {})
@source = source
@options.update options

@sexp = Grammar.new.parse(@source, self.file)
@sexp = Parser.new.parse(@source, self.file)

top_node = Nodes::TopNode.new(@sexp, :expr, self)
@fragments = top_node.compile_to_fragments.flatten
Expand Down
84 changes: 42 additions & 42 deletions lib/opal/grammar.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 689a501

Please sign in to comment.