ClassSetOperand ::= | '[' ClassSetExpression ']' | '\' CharacterClassEscape | '\q{' ClassStringDisjunctionContents '}' | ClassSetCharacter
()
| 746 | // | '\q{' ClassStringDisjunctionContents '}' |
| 747 | // | ClassSetCharacter |
| 748 | func (p *regExpParser) scanClassSetOperand() string { |
| 749 | p.mayContainStrings = false |
| 750 | switch p.char() { |
| 751 | case '[': |
| 752 | p.incPos(1) |
| 753 | p.scanClassSetExpression() |
| 754 | p.scanExpectedChar(']') |
| 755 | return "" |
| 756 | case '\\': |
| 757 | p.incPos(1) |
| 758 | if p.scanCharacterClassEscape() { |
| 759 | return "" |
| 760 | } else if p.char() == 'q' { |
| 761 | p.incPos(1) |
| 762 | if p.char() == '{' { |
| 763 | p.incPos(1) |
| 764 | p.scanClassStringDisjunctionContents() |
| 765 | p.scanExpectedChar('}') |
| 766 | return "" |
| 767 | } else { |
| 768 | p.error(diagnostics.X_q_must_be_followed_by_string_alternatives_enclosed_in_braces, p.pos()-2, 2) |
| 769 | return "q" |
| 770 | } |
| 771 | } |
| 772 | p.incPos(-1) |
| 773 | fallthrough |
| 774 | default: |
| 775 | return p.scanClassSetCharacter() |
| 776 | } |
| 777 | } |
| 778 | |
| 779 | // ClassStringDisjunctionContents ::= ClassSetCharacter* ('|' ClassSetCharacter*)* |
| 780 | func (p *regExpParser) scanClassStringDisjunctionContents() { |
no test coverage detected