- Sort Score
- Result 10 results
- Languages All
Results 1 - 5 of 5 for ScanToken (0.11 sec)
-
src/cmd/asm/internal/lex/tokenizer.go
t.base = base } func (t *Tokenizer) Line() int { return t.line } func (t *Tokenizer) Col() int { return t.s.Pos().Column } func (t *Tokenizer) Next() ScanToken { s := t.s for { t.tok = ScanToken(s.Scan()) if t.tok != scanner.Comment { break } text := s.TokenText() t.line += strings.Count(text, "\n") if constraint.IsGoBuild(text) { t.tok = BuildComment
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Thu Aug 04 20:35:21 UTC 2022 - 3K bytes - Viewed (0) -
src/cmd/asm/internal/lex/lex.go
"strings" "text/scanner" "cmd/internal/src" ) // A ScanToken represents an input item. It is a simple wrapping of rune, as // returned by text/scanner.Scanner, plus a couple of extra values. type ScanToken rune const ( // Asm defines some two-character lexemes. We make up // a rune/ScanToken value for them - ugly but simple. LSH ScanToken = -1000 - iota // << Left shift.
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Tue Aug 29 18:31:05 UTC 2023 - 4.1K bytes - Viewed (0) -
src/cmd/asm/internal/lex/slice.go
return &Slice{ tokens: tokens, base: base, line: line, pos: -1, // Next will advance to zero. } } func (s *Slice) Next() ScanToken { s.pos++ if s.pos >= len(s.tokens) { return scanner.EOF } return s.tokens[s.pos].ScanToken } func (s *Slice) Text() string { return s.tokens[s.pos].text } func (s *Slice) File() string { return s.base.Filename() }
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Thu Jun 29 22:49:50 UTC 2023 - 1.6K bytes - Viewed (0) -
src/cmd/asm/internal/asm/expr_test.go
if result != test.output { t.Errorf("%d: %q evaluated to %d; expected %d", i, test.input, result, test.output) } tok := p.next() if test.atEOF && tok.ScanToken != scanner.EOF { t.Errorf("%d: %q: at EOF got %s", i, test.input, tok) } else if !test.atEOF && tok.ScanToken == scanner.EOF { t.Errorf("%d: %q: expected not EOF but at EOF", i, test.input) } } } type badExprTest struct { input string
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Tue Aug 29 07:48:38 UTC 2023 - 3.2K bytes - Viewed (0) -
src/cmd/asm/internal/lex/stack.go
tr []TokenReader } // Push adds tr to the top (end) of the input stack. (Popping happens automatically.) func (s *Stack) Push(tr TokenReader) { s.tr = append(s.tr, tr) } func (s *Stack) Next() ScanToken { tos := s.tr[len(s.tr)-1] tok := tos.Next() for tok == scanner.EOF && len(s.tr) > 1 { tos.Close() // Pop the topmost item from the stack and resume with the next one down. s.tr = s.tr[:len(s.tr)-1]
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Mon Jan 09 22:33:23 UTC 2017 - 1.2K bytes - Viewed (0)