- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 121 for Tok (0.04 sec)
-
src/cmd/compile/internal/syntax/scanner.go
lit := s.segment() if len(lit) >= 2 { if tok := keywordMap[hash(lit)]; tok != 0 && tokStrFast(tok) == string(lit) { s.nlsemi = contains(1<<_Break|1<<_Continue|1<<_Fallthrough|1<<_Return, tok) s.tok = tok return } } s.nlsemi = true s.lit = string(lit) s.tok = _Name } // tokStrFast is a faster version of token.String, which assumes that tok
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Mar 28 18:17:41 UTC 2022 - 17.1K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go
tok(n.Map, len("map"))) case *ast.ParenExpr: children = append(children, tok(n.Lparen, len("(")), tok(n.Rparen, len(")"))) case *ast.RangeStmt: children = append(children, tok(n.For, len("for")), tok(n.TokPos, len(n.Tok.String()))) case *ast.ReturnStmt: children = append(children, tok(n.Return, len("return"))) case *ast.SelectStmt: children = append(children,
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Dec 18 21:28:13 UTC 2023 - 15.9K bytes - Viewed (0) -
src/cmd/asm/internal/lex/tokenizer.go
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 break } } switch t.tok { case '\n': t.line++ case '-': if s.Peek() == '>' { s.Next() t.tok = ARR return ARR } case '@':
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Aug 04 20:35:21 UTC 2022 - 3K bytes - Viewed (0) -
src/text/scanner/example_test.go
tsv [4][4]string // large enough for example above ) s.Init(strings.NewReader(src)) s.Whitespace ^= 1<<'\t' | 1<<'\n' // don't skip tabs and new lines for tok := s.Scan(); tok != scanner.EOF; tok = s.Scan() { switch tok { case '\n': row++ col = 0 case '\t': col++ default: tsv[row][col] = s.TokenText() } } fmt.Print(tsv) // Output:
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Sat Mar 10 02:01:58 UTC 2018 - 2.7K bytes - Viewed (0) -
src/cmd/asm/internal/lex/input.go
nesting := 0 var tokens []Token for { tok := in.Stack.Next() if tok == scanner.EOF || tok == '\n' { in.Error("unterminated arg list invoking macro:", macro.name) } if nesting == 0 && (tok == ')' || tok == ',') { return tokens, tok } if tok == '(' { nesting++ } if tok == ')' { nesting-- } tokens = append(tokens, Make(tok, in.Stack.Text())) } }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Aug 29 07:48:38 UTC 2023 - 12.6K bytes - Viewed (0) -
src/go/parser/parser.go
if p.trace && p.pos.IsValid() { s := p.tok.String() switch { case p.tok.IsLiteral(): p.printTrace(s, p.lit) case p.tok.IsOperator(), p.tok.IsKeyword(): p.printTrace("\"" + s + "\"") default: p.printTrace(s) } } for { p.pos, p.tok, p.lit = p.scanner.Scan() if p.tok == token.COMMENT { if p.top && strings.HasPrefix(p.lit, "//go:build") {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Dec 08 20:07:50 UTC 2023 - 72.2K bytes - Viewed (0) -
src/cmd/dist/buildtag.go
type exprToken struct { tok string prec int prefix func(*exprParser) val infix func(val, val) val } var exprTokens []exprToken func init() { // init to break init cycle exprTokens = []exprToken{ {tok: "&&", prec: 1, infix: func(x, y val) val { return x && y }}, {tok: "||", prec: 2, infix: func(x, y val) val { return x || y }}, {tok: "!", prec: 3, prefix: (*exprParser).not},
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 28 03:35:04 UTC 2021 - 3K bytes - Viewed (0) -
src/go/token/token.go
// delimiters; it returns false otherwise. func (tok Token) IsOperator() bool { return (operator_beg < tok && tok < operator_end) || tok == TILDE } // IsKeyword returns true for tokens corresponding to keywords; // it returns false otherwise. func (tok Token) IsKeyword() bool { return keyword_beg < tok && tok < keyword_end } // IsExported reports whether name starts with an upper-case letter.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 12:02:03 UTC 2023 - 6.4K bytes - Viewed (0) -
src/cmd/asm/internal/asm/parse.go
if tok == '\n' || tok == ';' || (nesting == 0 && (tok == ',' || tok == ':')) { if tok == ':' { // Remember this location so we can swap the operands below. if colon >= 0 { p.errorf("invalid ':' in operand") return word, cond, operands, true } colon = len(operands) } break } if tok == '(' || tok == '[' { nesting++ } if tok == ')' || tok == ']' {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Feb 21 14:34:57 UTC 2024 - 36.9K bytes - Viewed (0) -
src/go/printer/testdata/parser.go
// make the error message more specific if p.tok == token.SEMICOLON && p.lit[0] == '\n' { msg += ", found newline" } else { msg += ", found '" + p.tok.String() + "'" if p.tok.IsLiteral() { msg += " " + p.lit } } } p.error(pos, msg) } func (p *parser) expect(tok token.Token) token.Pos { pos := p.pos if p.tok != tok { p.errorExpected(pos, "'"+tok.String()+"'") }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Jul 20 20:19:51 UTC 2023 - 50.5K bytes - Viewed (0)