version 1.2, 2019/02/21 22:49:03 |
version 1.3, 2019/04/20 17:43:24 |
Line 12 func NewLinesLexer(lines Lines) *LinesLe |
|
Line 12 func NewLinesLexer(lines Lines) *LinesLe |
|
return &LinesLexer{lines, 0} |
return &LinesLexer{lines, 0} |
} |
} |
|
|
|
// CurrentLine returns the line that the lexer is currently looking at. |
|
// If it is at the end of file, the line number of the line is EOF. |
func (llex *LinesLexer) CurrentLine() Line { |
func (llex *LinesLexer) CurrentLine() Line { |
if llex.index < llex.lines.Len() { |
if llex.index < llex.lines.Len() { |
return llex.lines.Lines[llex.index] |
return llex.lines.Lines[llex.index] |