Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for IsLiteral (0.14 sec)

  1. src/cmd/go/internal/search/search.go

    func (m *Match) AddError(err error) {
    	m.Errs = append(m.Errs, &MatchError{Match: m, Err: err})
    }
    
    // IsLiteral reports whether the pattern is free of wildcards and meta-patterns.
    //
    // A literal pattern must match at most one package.
    func (m *Match) IsLiteral() bool {
    	return !strings.Contains(m.pattern, "...") && !m.IsMeta()
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 31 20:33:05 UTC 2023
    - 15.4K bytes
    - Viewed (0)
  2. 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)
  3. src/go/parser/error_test.go

    			// don't use the position of auto-inserted (invisible) semicolons
    			if lit != ";" {
    				break
    			}
    			fallthrough
    		default:
    			prev = pos
    			var l int // token length
    			if tok.IsLiteral() {
    				l = len(lit)
    			} else {
    				l = len(tok.String())
    			}
    			here = prev + token.Pos(l)
    		}
    	}
    }
    
    // compareErrors compares the map of expected error messages with the list
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 27 19:47:49 UTC 2022
    - 5.9K bytes
    - Viewed (0)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. 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)
  10. 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)
Back to top