Skip to content

Commit

Permalink
Merge pull request #6305 from tomachalek/supp2930
Browse files Browse the repository at this point in the history
Support ticket 2930
  • Loading branch information
tomachalek authored Sep 24, 2024
2 parents 110d49d + d9f5a76 commit 20e3f2b
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
4 changes: 4 additions & 0 deletions public/files/js/models/cqleditor/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,10 @@ export interface ParsedPQItem {
case 'NNUMBER':
case 'DASH':
case 'RG_OP':
case 'RG_CARET':
case 'RG_QM':
case 'RG_ANY':
case 'RG_REPEAT':
case 'RG_ESCAPED':
case 'NO_RG_SPEC':
case 'NO_RG_ESCAPED':
Expand Down
40 changes: 36 additions & 4 deletions scripts/build/cql.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ NO_RG_ESCAPED =
// ---------------- Regular expression with balanced parentheses --------

RegExp =
QUOT RegExpRaw QUOT / QUOT QUOT
QUOT RegExpRaw ("|" RegExpRaw?)* QUOT / QUOT QUOT

RegExpRaw =
(RgLook / RgGrouped / RgSimple)+

RgGrouped =
LPAREN _ RegExpRaw _ RPAREN
LPAREN _ RegExpRaw ("|" RegExpRaw?)* _ RPAREN

RgSimple =
(RgRange / RgChar / RgAlt / RgPosixClass)+
Expand All @@ -154,10 +154,42 @@ RgLookOperator =


RgAlt =
LBRACKET (RgChar / DASH)+ RBRACKET
LBRACKET RG_CARET? RgAltVal+ RBRACKET

RgAltVal =
AnyLetter "-" AnyLetter /
RgChar /
"|" /
QUOT /
LBRACE /
RBRACE /
LPAREN /
RPAREN /
DASH

RgChar =
RG_ESCAPED / AnyLetter / RG_OP / RG_NON_LETTER / RG_NON_SPEC / RG_AMP / RG_UNICODE_PROP
RG_ESCAPED /
RG_REPEAT /
RG_QM /
RG_ANY /
AnyLetter /
RG_OP /
RG_NON_LETTER /
RG_NON_SPEC /
RG_AMP /
RG_UNICODE_PROP

RG_CARET =
"^"

RG_QM =
"?"

RG_ANY =
"."

RG_REPEAT =
[*+]

RG_OP =
[,\-_\^\$ ] / [0-9\?\*\+\.\|]
Expand Down

0 comments on commit 20e3f2b

Please sign in to comment.