Module: Johnson::Parser
- Defined in:
- lib/johnson/parser.rb,
lib/johnson/parser/syntax_error.rb
Defined Under Namespace
Classes: SyntaxError
Class Method Summary collapse
- .parse(js, filename = nil, linenum = nil) ⇒ Object
- .parse_io(js, filename = nil, linenum = nil) ⇒ Object
Class Method Details
.parse(js, filename = nil, linenum = nil) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/johnson/parser.rb', line 8 def parse(js, filename = nil, linenum = nil) tree = if js.is_a?(String) parse_io(StringIO.new(js), filename, linenum) else parse_io(js, filename, linenum) end tree.to_mutable_tree end |