Class: Yoda::Parsing::Parser
- Inherits:
-
Object
- Object
- Yoda::Parsing::Parser
- Defined in:
- lib/yoda/parsing/parser.rb
Instance Method Summary collapse
- #parse(string) ⇒ ::Parser::AST::Node
- #parse_with_comments(string) ⇒ (::Parser::AST::Node, Array<::Parser::Source::Comment>)
- #parse_with_comments_if_valid(string) ⇒ (::Parser::AST::Node, Array<::Parser::Source::Comment>)?
Instance Method Details
#parse(string) ⇒ ::Parser::AST::Node
8 9 10 |
# File 'lib/yoda/parsing/parser.rb', line 8 def parse(string) ::Parser::CurrentRuby.parse(string) end |
#parse_with_comments(string) ⇒ (::Parser::AST::Node, Array<::Parser::Source::Comment>)
14 15 16 |
# File 'lib/yoda/parsing/parser.rb', line 14 def parse_with_comments(string) ::Parser::CurrentRuby.parse_with_comments(string) end |
#parse_with_comments_if_valid(string) ⇒ (::Parser::AST::Node, Array<::Parser::Source::Comment>)?
20 21 22 23 24 |
# File 'lib/yoda/parsing/parser.rb', line 20 def parse_with_comments_if_valid(string) parse_with_comments(source) rescue ::Parser::SyntaxError nil end |