Class: Fmt::ArgumentsParser
- Defined in:
- lib/fmt/parsers/arguments_parser.rb
Overview
Parses arguments from a string and builds an AST (Abstract Syntax Tree)
Constant Summary
Constants inherited from Parser
Instance Attribute Summary collapse
-
#tokens ⇒ Object
readonly
: Array – wrapped ripper tokens.
Instance Method Summary collapse
-
#initialize(tokens = []) ⇒ ArgumentsParser
constructor
Constructor.
-
#parse ⇒ Object
Parses the urtext (original source code).
Methods inherited from Parser
Constructor Details
#initialize(tokens = []) ⇒ ArgumentsParser
Constructor
10 11 12 |
# File 'lib/fmt/parsers/arguments_parser.rb', line 10 def initialize(tokens = []) @tokens = tokens end |
Instance Attribute Details
#tokens ⇒ Object (readonly)
: Array – wrapped ripper tokens
14 15 16 |
# File 'lib/fmt/parsers/arguments_parser.rb', line 14 def tokens @tokens end |
Instance Method Details
#parse ⇒ Object
Parses the urtext (original source code)
18 19 20 |
# File 'lib/fmt/parsers/arguments_parser.rb', line 18 def parse cache(tokens.to_s) { super } end |