Module: Fbtxt

Defined in:
lib/fbtxt/parser/parser.rb,
lib/fbtxt/parser.rb,
lib/fbtxt/parser/version.rb,
lib/fbtxt/parser/parse_tree.rb,
lib/fbtxt/parser/parser-top.rb,
lib/fbtxt/parser/parse_tree-match.rb,
lib/fbtxt/parser/parse_tree-props.rb

Overview

require 'racc/parser.rb'

Defined Under Namespace

Modules: Module Classes: Parser, ParserResult

Class Method Summary collapse

Class Method Details

.parse(txt) ⇒ Object

returns Fbtxt::ParserResult (ok?/tree/errors)



60
61
62
63
64
65
# File 'lib/fbtxt/parser.rb', line 60

def self.parse( txt )   ## returns Fbtxt::ParserResult (ok?/tree/errors)
  parser = Parser.new( txt )
  ## move "wrapping" into result obj inside parser - why? why not?
  tree, errors = parser.parse_with_errors
  ParserResult.new( tree, errors )
end