Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 78 for Tok (0.1 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. src/cmd/compile/internal/syntax/parser.go

    	}
    
    	// determine token string
    	var tok string
    	switch p.tok {
    	case _Name:
    		tok = "name " + p.lit
    	case _Semi:
    		tok = p.lit
    	case _Literal:
    		tok = "literal " + p.lit
    	case _Operator:
    		tok = p.op.String()
    	case _AssignOp:
    		tok = p.op.String() + "="
    	case _IncOp:
    		tok = p.op.String()
    		tok += tok
    	default:
    		tok = tokstring(p.tok)
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 62.9K bytes
    - Viewed (0)
  8. src/go/internal/gccgoimporter/parser.go

    		p.expectEOL()
    
    	case "init":
    		p.next()
    		for p.tok != '\n' && p.tok != ';' && p.tok != scanner.EOF {
    			p.initdata.Inits = append(p.initdata.Inits, p.parsePackageInit())
    		}
    		p.expectEOL()
    
    	case "init_graph":
    		p.next()
    		// The graph data is thrown away for now.
    		for p.tok != '\n' && p.tok != ';' && p.tok != scanner.EOF {
    			p.parseInt64()
    			p.parseInt64()
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 02 23:14:07 UTC 2024
    - 31.2K bytes
    - Viewed (0)
  9. src/go/scanner/scanner_test.go

    		}
    	`
    	var s Scanner
    	s.Init(fset.AddFile("", fset.Base(), len(src)), []byte(src), nil, 0)
    	for {
    		pos, tok, lit := s.Scan()
    		class := tokenclass(tok)
    		if lit != "" && class != keyword && class != literal && tok != token.SEMICOLON {
    			t.Errorf("%s: tok = %s, lit = %q", fset.Position(pos), tok, lit)
    		}
    		if tok <= token.EOF {
    			break
    		}
    	}
    }
    
    func TestIssue28112(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 28 15:38:31 UTC 2023
    - 34.6K bytes
    - Viewed (0)
  10. src/go/scanner/scanner.go

    		case ';':
    			tok = token.SEMICOLON
    			lit = ";"
    		case '(':
    			tok = token.LPAREN
    		case ')':
    			insertSemi = true
    			tok = token.RPAREN
    		case '[':
    			tok = token.LBRACK
    		case ']':
    			insertSemi = true
    			tok = token.RBRACK
    		case '{':
    			tok = token.LBRACE
    		case '}':
    			insertSemi = true
    			tok = token.RBRACE
    		case '+':
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 12:02:03 UTC 2023
    - 24.3K bytes
    - Viewed (0)
Back to top