Home | History | Annotate | Download | only in scanner

Lines Matching refs:Line

74 	{Comment, "// line comments"},
236 func checkTok(t *testing.T, s *Scanner, line int, got, want rune, text string) {
240 if s.Line != line {
241 t.Errorf("line = %d, want %d for %q", s.Line, line, text)
269 line := 1
272 checkTok(t, s, line, tok, k.tok, k.text)
275 line += countNewlines(k.text) + 1 // each token is on a new line
277 checkTok(t, s, line, tok, EOF, "")
295 if s.Line != pos.Line {
296 t.Errorf("line = %d, want %d for %q", s.Line, pos.Line, k.text)
302 pos.Line += countNewlines(k.text) + 1 // each token is on a new line
385 s := new(Scanner).Init(strings.NewReader(BOMs + "if a == bcd /* com" + BOMs + "ment */ {\n\ta += c\n}" + BOMs + "// line comment ending in eof"))
515 if got.Offset != want.Offset || got.Line != want.Line || got.Column != want.Column {
516 t.Errorf("got offset, line, column = %d, %d, %d; want %d, %d, %d",
517 got.Offset, got.Line, got.Column, want.Offset, want.Line, want.Column)
521 func checkNextPos(t *testing.T, s *Scanner, offset, line, column int, char rune) {
525 want := Position{Offset: offset, Line: line, Column: column}
529 func checkScanPos(t *testing.T, s *Scanner, offset, line, column int, char rune) {
530 want := Position{Offset: offset, Line: line, Column: column}
544 checkPos(t, s.Pos(), Position{Offset: 0, Line: 1, Column: 1})
546 checkPos(t, s.Pos(), Position{Offset: 0, Line: 1, Column: 1})
550 checkPos(t, s.Pos(), Position{Offset: 0, Line: 1, Column: 1})
562 checkPos(t, s.Pos(), Position{Offset: 0, Line: 1, Column: 1})