MCPcopy Create free account
hub / github.com/dlclark/regexp2 / typeFromCode

Method typeFromCode

syntax/parser.go:1527–1550  ·  view source on GitHub ↗

Returns ReNode type for zero-length assertions with a \ code.

(ch rune)

Source from the content-addressed store, hash-verified

1525
1526// Returns ReNode type for zero-length assertions with a \ code.
1527func (p *parser) typeFromCode(ch rune) NodeType {
1528 switch ch {
1529 case 'b':
1530 if p.useOptionE() {
1531 return NtECMABoundary
1532 }
1533 return NtBoundary
1534 case 'B':
1535 if p.useOptionE() {
1536 return NtNonECMABoundary
1537 }
1538 return NtNonboundary
1539 case 'A':
1540 return NtBeginning
1541 case 'G':
1542 return NtStart
1543 case 'Z':
1544 return NtEndZ
1545 case 'z':
1546 return NtEnd
1547 default:
1548 return NtNothing
1549 }
1550}
1551
1552// Scans whitespace or x-mode comments.
1553func (p *parser) scanBlank() error {

Callers 1

scanBackslashMethod · 0.95

Calls 1

useOptionEMethod · 0.95

Tested by

no test coverage detected