equal
deleted
inserted
replaced
124 // acceptRun consumes a run of runes from the valid set. |
124 // acceptRun consumes a run of runes from the valid set. |
125 func (l *lexer) acceptRun(valid string) { |
125 func (l *lexer) acceptRun(valid string) { |
126 for strings.ContainsRune(valid, l.next()) { |
126 for strings.ContainsRune(valid, l.next()) { |
127 } |
127 } |
128 l.backup() |
128 l.backup() |
129 } |
|
130 |
|
131 // acceptRunUntil consumes a run of runes up to a terminator. |
|
132 func (l *lexer) acceptRunUntil(term rune) { |
|
133 for term != l.next() { |
|
134 } |
|
135 l.backup() |
|
136 } |
|
137 |
|
138 // hasText returns true if the current parsed text is not empty. |
|
139 func (l *lexer) isNotEmpty() bool { |
|
140 return l.pos > l.start |
|
141 } |
129 } |
142 |
130 |
143 // lineNumber reports which line we're on, based on the position of |
131 // lineNumber reports which line we're on, based on the position of |
144 // the previous item returned by nextItem. Doing it this way |
132 // the previous item returned by nextItem. Doing it this way |
145 // means we don't have to worry about peek double counting. |
133 // means we don't have to worry about peek double counting. |