Class: Wexpr::PrivateParserState
- Defined in:
- lib/wexpr/private_parser_state.rb
Overview
Internal class which manges the parser state when parsing
Instance Attribute Summary collapse
-
#column ⇒ Object
Returns the value of attribute column.
-
#externalReferenceMap ⇒ Object
Returns the value of attribute externalReferenceMap.
-
#internalReferenceMap ⇒ Object
Returns the value of attribute internalReferenceMap.
-
#line ⇒ Object
Returns the value of attribute line.
Instance Method Summary collapse
-
#initialize ⇒ PrivateParserState
constructor
A new instance of PrivateParserState.
- #move_forward_based_on_string(str) ⇒ Object
Constructor Details
#initialize ⇒ PrivateParserState
Returns a new instance of PrivateParserState.
12 13 14 15 16 17 18 |
# File 'lib/wexpr/private_parser_state.rb', line 12 def initialize() # start at beginning of file @line = 1 @column = 1 @internalReferenceMap = {} @externalReferenceMap = {} end |
Instance Attribute Details
#column ⇒ Object
Returns the value of attribute column.
8 9 10 |
# File 'lib/wexpr/private_parser_state.rb', line 8 def column @column end |
#externalReferenceMap ⇒ Object
Returns the value of attribute externalReferenceMap.
10 11 12 |
# File 'lib/wexpr/private_parser_state.rb', line 10 def externalReferenceMap @externalReferenceMap end |
#internalReferenceMap ⇒ Object
Returns the value of attribute internalReferenceMap.
9 10 11 |
# File 'lib/wexpr/private_parser_state.rb', line 9 def internalReferenceMap @internalReferenceMap end |
#line ⇒ Object
Returns the value of attribute line.
7 8 9 |
# File 'lib/wexpr/private_parser_state.rb', line 7 def line @line end |
Instance Method Details
#move_forward_based_on_string(str) ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/wexpr/private_parser_state.rb', line 20 def move_forward_based_on_string(str) str.each_char do |c| if c == '\n' # newline @line += 1 @column = 1 else @column = 1 end end end |