Class: TreeHaver::Base::Parser
- Inherits:
-
Object
- Object
- TreeHaver::Base::Parser
- Defined in:
- lib/tree_haver/base/parser.rb
Overview
Base class for backend Parser implementations Used by wrapper backends (Commonmarker, Markly, etc.) Raw backends (MRI/Rust) do not inherit from this.
Direct Known Subclasses
TreeHaver::Backends::Prism::Parser, TreeHaver::Backends::Psych::Parser
Instance Attribute Summary collapse
-
#language ⇒ Object
Returns the value of attribute language.
Instance Method Summary collapse
-
#initialize ⇒ Parser
constructor
A new instance of Parser.
- #parse(source) ⇒ Object
- #parse_string(_old_tree, source) ⇒ Object
Constructor Details
#initialize ⇒ Parser
Returns a new instance of Parser.
11 12 13 |
# File 'lib/tree_haver/base/parser.rb', line 11 def initialize @language = nil end |
Instance Attribute Details
#language ⇒ Object
Returns the value of attribute language.
9 10 11 |
# File 'lib/tree_haver/base/parser.rb', line 9 def language @language end |
Instance Method Details
#parse(source) ⇒ Object
15 16 17 |
# File 'lib/tree_haver/base/parser.rb', line 15 def parse(source) raise NotImplementedError end |
#parse_string(_old_tree, source) ⇒ Object
19 20 21 |
# File 'lib/tree_haver/base/parser.rb', line 19 def parse_string(_old_tree, source) parse(source) end |