Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for IsLiteral (0.13 sec)

  1. src/go/token/token.go

    	if tok, is_keyword := keywords[ident]; is_keyword {
    		return tok
    	}
    	return IDENT
    }
    
    // Predicates
    
    // IsLiteral returns true for tokens corresponding to identifiers
    // and basic type literals; it returns false otherwise.
    func (tok Token) IsLiteral() bool { return literal_beg < tok && tok < literal_end }
    
    // IsOperator returns true for tokens corresponding to operators and
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 12:02:03 UTC 2023
    - 6.4K bytes
    - Viewed (0)
  2. src/cmd/go/internal/modload/search.go

    	match := search.NewMatch(pattern)
    	if m == (module.Version{}) {
    		matchPackages(ctx, match, tags, includeStd, nil)
    	}
    
    	LoadModFile(ctx) // Sets Target, needed by fetch and matchPackages.
    
    	if !match.IsLiteral() {
    		matchPackages(ctx, match, tags, omitStd, []module.Version{m})
    		return match
    	}
    
    	root, isLocal, err := fetch(ctx, m)
    	if err != nil {
    		match.Errs = []error{err}
    		return match
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 08 17:55:15 UTC 2023
    - 7.9K bytes
    - Viewed (0)
  3. src/regexp/all_test.go

    		// Literal method needs to scan the pattern.
    		re := MustCompile(tc.pattern)
    		str, complete := re.LiteralPrefix()
    		if complete != tc.isLiteral {
    			t.Errorf("LiteralPrefix(`%s`) = %t; want %t", tc.pattern, complete, tc.isLiteral)
    		}
    		if str != tc.literal {
    			t.Errorf("LiteralPrefix(`%s`) = `%s`; want `%s`", tc.pattern, str, tc.literal)
    		}
    	}
    }
    
    type subexpIndex struct {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:36:03 UTC 2024
    - 25.8K bytes
    - Viewed (0)
  4. src/go/scanner/scanner_test.go

    	"strings"
    	"testing"
    )
    
    var fset = token.NewFileSet()
    
    const /* class */ (
    	special = iota
    	literal
    	operator
    	keyword
    )
    
    func tokenclass(tok token.Token) int {
    	switch {
    	case tok.IsLiteral():
    		return literal
    	case tok.IsOperator():
    		return operator
    	case tok.IsKeyword():
    		return keyword
    	}
    	return special
    }
    
    type elt struct {
    	tok   token.Token
    	lit   string
    	class int
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 28 15:38:31 UTC 2023
    - 34.6K bytes
    - Viewed (0)
  5. src/cmd/go/internal/load/pkg.go

    		for _, pkg := range m.Pkgs {
    			if pkg == "" {
    				panic(fmt.Sprintf("ImportPaths returned empty package for pattern %s", m.Pattern()))
    			}
    			mode := cmdlinePkg
    			if m.IsLiteral() {
    				// Note: do not set = m.IsLiteral unconditionally
    				// because maybe we'll see p matching both
    				// a literal and also a non-literal pattern.
    				mode |= cmdlinePkgLiteral
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 28 17:00:51 UTC 2024
    - 120K bytes
    - Viewed (0)
  6. src/go/parser/parser.go

    	// very first token (!p.pos.IsValid()) is not initialized
    	// (it is token.ILLEGAL), so don't print it.
    	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()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 08 20:07:50 UTC 2023
    - 72.2K bytes
    - Viewed (0)
  7. src/go/printer/testdata/parser.go

    	// very first token (!p.pos.IsValid()) is not initialized
    	// (it is token.ILLEGAL), so don't print it.
    	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)
    		}
    	}
    
    	p.pos, p.tok, p.lit = p.scanner.Scan()
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 20 20:19:51 UTC 2023
    - 50.5K bytes
    - Viewed (0)
  8. src/cmd/go/internal/modload/load.go

    				// the loader iterations.
    				m.Pkgs = m.Pkgs[:0]
    				for _, dir := range m.Dirs {
    					pkg, err := resolveLocalPackage(ctx, dir, rs)
    					if err != nil {
    						if !m.IsLiteral() && (err == errPkgIsBuiltin || err == errPkgIsGorootSrc) {
    							continue // Don't include "builtin" or GOROOT/src in wildcard patterns.
    						}
    
    						// If we're outside of a module, ensure that the failure mode
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 14:56:56 UTC 2024
    - 84K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go

    		{"(*FileSet).Write", Method, 0},
    		{"(*Position).IsValid", Method, 0},
    		{"(Pos).IsValid", Method, 0},
    		{"(Position).String", Method, 0},
    		{"(Token).IsKeyword", Method, 0},
    		{"(Token).IsLiteral", Method, 0},
    		{"(Token).IsOperator", Method, 0},
    		{"(Token).Precedence", Method, 0},
    		{"(Token).String", Method, 0},
    		{"ADD", Const, 0},
    		{"ADD_ASSIGN", Const, 0},
    		{"AND", Const, 0},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 534.2K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apiserver/pkg/cel/library/cost.go

    			sz := l.sizeEstimate(*target)
    
    			// Worst case size is where is that a separator of "" is used, and each char is returned as a list element.
    			max := sz.Max
    			if len(args) > 1 {
    				if v := args[1].Expr().AsLiteral(); v != nil {
    					if i, ok := v.Value().(int64); ok {
    						max = uint64(i)
    					}
    				}
    			}
    			// Cost is the traversal plus the construction of the result.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Apr 23 17:22:44 UTC 2024
    - 20.6K bytes
    - Viewed (0)
Back to top