Class: SyntaxTree::ERB::Parser
- Inherits:
-
Object
- Object
- SyntaxTree::ERB::Parser
- Defined in:
- lib/syntax_tree/erb/parser.rb
Defined Under Namespace
Classes: MissingTokenError
Instance Attribute Summary collapse
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#tokens ⇒ Object
readonly
Returns the value of attribute tokens.
Instance Method Summary collapse
- #debug_tokens ⇒ Object
-
#initialize(source) ⇒ Parser
constructor
A new instance of Parser.
- #parse ⇒ Object
Constructor Details
#initialize(source) ⇒ Parser
Returns a new instance of Parser.
18 19 20 21 22 |
# File 'lib/syntax_tree/erb/parser.rb', line 18 def initialize(source) @source = source @tokens = make_tokens @found_doctype = false end |
Instance Attribute Details
#source ⇒ Object (readonly)
Returns the value of attribute source.
16 17 18 |
# File 'lib/syntax_tree/erb/parser.rb', line 16 def source @source end |
#tokens ⇒ Object (readonly)
Returns the value of attribute tokens.
16 17 18 |
# File 'lib/syntax_tree/erb/parser.rb', line 16 def tokens @tokens end |
Instance Method Details
#debug_tokens ⇒ Object
33 34 35 36 37 |
# File 'lib/syntax_tree/erb/parser.rb', line 33 def debug_tokens @tokens.each do |key, value, index, line| puts("#{key} #{value.inspect} #{index} #{line}") end end |