Class: TreeHaver::Base::Parser

Inherits:
Object
  • Object
show all
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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeParser

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

#languageObject

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

Raises:

  • (NotImplementedError)


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