Lines Matching refs:regexp
22 return "error parsing regexp: " + e.Code.String() + ": `" + e.Expr + "`"
30 ErrInternalError ErrorCode = "regexp/syntax: internal error"
52 // Flags control the behavior of the parser and record information about regexp context.
64 WasDollar // regexp OpEndText was $, not \z
65 Simple // regexp contains no counted repetition
81 stack []*Regexp // stack of parsed expressions
82 free *Regexp
88 func (p *parser) newRegexp(op Op) *Regexp {
92 *re = Regexp{}
94 re = new(Regexp)
100 func (p *parser) reuse(re *Regexp) {
107 // push pushes the regexp re onto the parse stack and returns the regexp.
108 func (p *parser) push(re *Regexp) *Regexp {
180 // newLiteral returns a new OpLiteral Regexp with the given flags
181 func (p *parser) newLiteral(r rune, flags Flags) *Regexp {
207 // literal pushes a literal regexp for the rune r on the stack
208 // and returns that regexp.
213 // op pushes a regexp with the given op onto the stack
214 // and returns that regexp.
215 func (p *parser) op(op Op) *Regexp {
222 // before is the regexp suffix starting at the repetition operator.
223 // after is the regexp suffix following after the repetition operator.
267 // This function rewalks the regexp tree and is called for every repetition,
272 func repeatIsValid(re *Regexp, n int) bool {
297 func (p *parser) concat() *Regexp {
317 func (p *parser) alternate() *Regexp {
343 func cleanAlt(re *Regexp) {
369 func (p *parser) collapse(subs []*Regexp, op Op) *Regexp {
405 func (p *parser) factor(sub []*Regexp, flags Flags) []*Regexp {
483 var first *Regexp
490 var ifirst *Regexp
500 // Found end of a run with common leading regexp:
503 // Factor out common regexp and append factored expression to out.
551 // Start with most complex regexp in sub[start].
592 func (p *parser) leadingString(re *Regexp) ([]rune, Flags) {
604 func (p *parser) removeLeadingString(re *Regexp, n int) *Regexp {
639 // leadingRegexp returns the leading regexp that re begins with.
640 // The regexp refers to storage in re or its children.
641 func (p *parser) leadingRegexp(re *Regexp) *Regexp {
655 // removeLeadingRegexp removes the leading regexp in re.
657 // If reuse is true, it passes the removed regexp (if no longer needed) to p.reuse.
658 func (p *parser) removeLeadingRegexp(re *Regexp, reuse bool) *Regexp {
681 func literalRegexp(s string, flags Flags) *Regexp {
682 re := &Regexp{Op: OpLiteral}
701 func Parse(s string, flags Flags) (*Regexp, error) {
950 // Check for named captures, first introduced in Python's regexp library.
1099 func isCharClass(re *Regexp) bool {
1107 func matchRune(re *Regexp, r rune) bool {
1144 func mergeCharClass(dst, src *Regexp) {