Returns ReNode type for zero-length assertions with a \ code.
(ch rune)
| 1525 | |
| 1526 | // Returns ReNode type for zero-length assertions with a \ code. |
| 1527 | func (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. |
| 1553 | func (p *parser) scanBlank() error { |
no test coverage detected