Class: LexerKit::DFA::RegexAST::Meta
- Inherits:
-
Data
- Object
- Data
- LexerKit::DFA::RegexAST::Meta
- Defined in:
- lib/lexer_kit/dfa/regex_ast.rb
Overview
Metadata for AST nodes (source location, original text, etc.)
Instance Attribute Summary collapse
-
#bytes ⇒ Object
readonly
Returns the value of attribute bytes.
-
#codepoint ⇒ Object
readonly
Returns the value of attribute codepoint.
-
#literal_text ⇒ Object
readonly
Returns the value of attribute literal_text.
-
#span ⇒ Object
readonly
Returns the value of attribute span.
Instance Method Summary collapse
Instance Attribute Details
#bytes ⇒ Object (readonly)
Returns the value of attribute bytes
9 10 11 |
# File 'lib/lexer_kit/dfa/regex_ast.rb', line 9 def bytes @bytes end |
#codepoint ⇒ Object (readonly)
Returns the value of attribute codepoint
9 10 11 |
# File 'lib/lexer_kit/dfa/regex_ast.rb', line 9 def codepoint @codepoint end |
#literal_text ⇒ Object (readonly)
Returns the value of attribute literal_text
9 10 11 |
# File 'lib/lexer_kit/dfa/regex_ast.rb', line 9 def literal_text @literal_text end |
#span ⇒ Object (readonly)
Returns the value of attribute span
9 10 11 |
# File 'lib/lexer_kit/dfa/regex_ast.rb', line 9 def span @span end |
Instance Method Details
#to_s ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/lexer_kit/dfa/regex_ast.rb', line 10 def to_s parts = [] parts << "span=#{span.inspect}" if span parts << "text=#{literal_text.inspect}" if literal_text parts << "cp=U+#{codepoint.to_s(16).upcase}" if codepoint "{#{parts.join(', ')}}" end |