Class: Fmt::MacroParser
- Defined in:
- lib/fmt/parsers/macro_parser.rb
Overview
Parses a macro from a string and builds an AST (Abstract Syntax Tree)
Constant Summary
Constants inherited from Parser
Instance Attribute Summary collapse
-
#urtext ⇒ Object
readonly
: String – original source code.
Instance Method Summary collapse
-
#initialize(urtext = "") ⇒ MacroParser
constructor
Constructor.
-
#parse ⇒ Object
Parses the urtext (original source code).
Methods inherited from Parser
Constructor Details
#initialize(urtext = "") ⇒ MacroParser
Constructor
10 11 12 |
# File 'lib/fmt/parsers/macro_parser.rb', line 10 def initialize(urtext = "") @urtext = urtext.to_s.encode(Encoding::UTF_8, invalid: :replace, undef: :replace, replace: "?") end |
Instance Attribute Details
#urtext ⇒ Object (readonly)
: String – original source code
14 15 16 |
# File 'lib/fmt/parsers/macro_parser.rb', line 14 def urtext @urtext end |
Instance Method Details
#parse ⇒ Object
Parses the urtext (original source code)
18 19 20 |
# File 'lib/fmt/parsers/macro_parser.rb', line 18 def parse cache(urtext) { super } end |