- Sort Score
- Result 10 results
- Languages All
Results 1 - 4 of 4 for CompileOnePass (0.2 sec)
-
src/regexp/onepass_test.go
re = re.Simplify() if p, err = syntax.Compile(re); err != nil { t.Errorf("Compile(%q) got err:%s, want success", test.re, err) continue } isOnePass := compileOnePass(p) != nil if isOnePass != test.isOnePass { t.Errorf("CompileOnePass(%q) got isOnePass=%v, expected %v", test.re, isOnePass, test.isOnePass) } } } // TODO(cespare): Unify with onePassTests and rationalize one-pass test cases.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Mar 25 19:36:03 UTC 2024 - 4.6K bytes - Viewed (0) -
src/regexp/onepass.go
} } return p } // compileOnePass returns a new *syntax.Prog suitable for onePass execution if the original Prog // can be recharacterized as a one-pass regexp program, or syntax.nil if the // Prog cannot be converted. For a one pass prog, the fundamental condition that must // be true is: at any InstAlt, there must be no ambiguity about what branch to take. func compileOnePass(prog *syntax.Prog) (p *onePassProg) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Mar 25 19:36:03 UTC 2024 - 13.7K bytes - Viewed (0) -
src/regexp/all_test.go
if err != nil { t.Fatalf("parse: %v", err) } p, err := syntax.Compile(re.Simplify()) if err != nil { t.Fatalf("compile: %v", err) } if compileOnePass(p) != nil { t.Fatalf("makeOnePass succeeded; wanted nil") } } // Check that the same machine can be used with the standard matcher // and then the backtracker when there are no captures.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Mar 25 19:36:03 UTC 2024 - 25.8K bytes - Viewed (0) -
src/regexp/regexp.go
if err != nil { return nil, err } matchcap := prog.NumCap if matchcap < 2 { matchcap = 2 } regexp := &Regexp{ expr: expr, prog: prog, onepass: compileOnePass(prog), numSubexp: maxCap, subexpNames: capNames, cond: prog.StartCond(), longest: longest, matchcap: matchcap, minInputLen: minInputLen(re), } if regexp.onepass == nil {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Feb 26 20:50:01 UTC 2024 - 38.5K bytes - Viewed (0)