diff --git a/cpp/ql/test/library-tests/regex/parse.expected b/cpp/ql/test/library-tests/regex/parse.expected index e2897718244..32bf025e6d7 100644 --- a/cpp/ql/test/library-tests/regex/parse.expected +++ b/cpp/ql/test/library-tests/regex/parse.expected @@ -42,6 +42,32 @@ #-----| [RegExpConstant, RegExpNormalChar] [ +#-----| [RegExpConstant, RegExpNormalChar] [ + +#-----| [RegExpConstant, RegExpNormalChar] = + +#-----| [RegExpConstant, RegExpNormalChar] b + +#-----| [RegExpConstant, RegExpNormalChar] = + +#-----| [RegExpConstant, RegExpNormalChar] ]a-f] + +#-----| [RegExpConstant, RegExpNormalChar] [ + +#-----| [RegExpConstant, RegExpNormalChar] = + +#-----| [RegExpConstant, RegExpNormalChar] a + +#-----| [RegExpConstant, RegExpNormalChar] = + +#-----| [RegExpConstant, RegExpNormalChar] ] + +#-----| [RegExpConstant, RegExpNormalChar] A + +#-----| [RegExpConstant, RegExpNormalChar] F + +#-----| [RegExpConstant, RegExpNormalChar] [ + #-----| [RegExpConstant, RegExpNormalChar] a-f] #-----| [RegExpConstant, RegExpNormalChar] A @@ -179,6 +205,14 @@ #-----| 1 -> [RegExpConstant, RegExpEscape] \n #-----| 2 -> [RegExpConstant, RegExpNormalChar] b +#-----| [RegExpSequence] [A-F[[=b=]]a-f] +#-----| 0 -> [RegExpCharacterClass] [A-F[[=b=] +#-----| 1 -> [RegExpConstant, RegExpNormalChar] ]a-f] + +#-----| [RegExpSequence] [[=a=]] +#-----| 0 -> [RegExpCharacterClass] [[=a=] +#-----| 1 -> [RegExpConstant, RegExpNormalChar] ] + #-----| [RegExpSequence] [A-F[[.b.]]a-f] #-----| 0 -> [RegExpCharacterClass] [A-F[[.b.]] #-----| 1 -> [RegExpConstant, RegExpNormalChar] a-f] @@ -283,6 +317,10 @@ #-----| 0 -> [RegExpConstant, RegExpNormalChar] A #-----| 1 -> [RegExpConstant, RegExpNormalChar] F +#-----| [RegExpCharacterRange] A-F +#-----| 0 -> [RegExpConstant, RegExpNormalChar] A +#-----| 1 -> [RegExpConstant, RegExpNormalChar] F + #-----| [RegExpCharacterRange] a-f #-----| 0 -> [RegExpConstant, RegExpNormalChar] a #-----| 1 -> [RegExpConstant, RegExpNormalChar] f @@ -313,6 +351,20 @@ #-----| [RegExpCharacterClass] [\cZ] #-----| 0 -> [RegExpConstant, RegExpEscape] \cZ +#-----| [RegExpCharacterClass] [A-F[[=b=] +#-----| 0 -> [RegExpCharacterRange] A-F +#-----| 1 -> [RegExpConstant, RegExpNormalChar] [ +#-----| 2 -> [RegExpConstant, RegExpNormalChar] [ +#-----| 3 -> [RegExpConstant, RegExpNormalChar] = +#-----| 4 -> [RegExpConstant, RegExpNormalChar] b +#-----| 5 -> [RegExpConstant, RegExpNormalChar] = + +#-----| [RegExpCharacterClass] [[=a=] +#-----| 0 -> [RegExpConstant, RegExpNormalChar] [ +#-----| 1 -> [RegExpConstant, RegExpNormalChar] = +#-----| 2 -> [RegExpConstant, RegExpNormalChar] a +#-----| 3 -> [RegExpConstant, RegExpNormalChar] = + #-----| [RegExpCharacterClass] [A-F[[.b.]] #-----| 0 -> [RegExpCharacterRange] A-F #-----| 1 -> [RegExpConstant, RegExpNormalChar] [ diff --git a/cpp/ql/test/library-tests/regex/regexp.cpp b/cpp/ql/test/library-tests/regex/regexp.cpp index ebf3b49367f..8806b654807 100644 --- a/cpp/ql/test/library-tests/regex/regexp.cpp +++ b/cpp/ql/test/library-tests/regex/regexp.cpp @@ -74,6 +74,10 @@ std::regex r_posix3("[A-F[:digit:]a-f]"); std::regex r_posix_coll1("[[.a.]]"); std::regex r_posix_coll2("[A-F[[.b.]]a-f]"); +// POSIX equivalence classes +std::regex r_posix_equiv1("[[=a=]]"); +std::regex r_posix_equiv2("[A-F[[=b=]]a-f]"); + // *Not* a POSIX bracket expression; just a regular character class. std::regex r_posix4("[:digit:]"); diff --git a/cpp/ql/test/library-tests/regex/regexp.expected b/cpp/ql/test/library-tests/regex/regexp.expected index 9c7f8506d32..b8c4976a0df 100644 --- a/cpp/ql/test/library-tests/regex/regexp.expected +++ b/cpp/ql/test/library-tests/regex/regexp.expected @@ -29,10 +29,16 @@ term | file://:0:0:0:0 | .* | RegExpStar | | file://:0:0:0:0 | : | RegExpConstant,RegExpNormalChar | | file://:0:0:0:0 | :+ | RegExpPlus | +| file://:0:0:0:0 | = | RegExpConstant,RegExpNormalChar | +| file://:0:0:0:0 | = | RegExpConstant,RegExpNormalChar | +| file://:0:0:0:0 | = | RegExpConstant,RegExpNormalChar | +| file://:0:0:0:0 | = | RegExpConstant,RegExpNormalChar | | file://:0:0:0:0 | A | RegExpConstant,RegExpNormalChar | | file://:0:0:0:0 | A | RegExpConstant,RegExpNormalChar | | file://:0:0:0:0 | A | RegExpConstant,RegExpNormalChar | | file://:0:0:0:0 | A | RegExpConstant,RegExpNormalChar | +| file://:0:0:0:0 | A | RegExpConstant,RegExpNormalChar | +| file://:0:0:0:0 | A-F | RegExpCharacterRange | | file://:0:0:0:0 | A-F | RegExpCharacterRange | | file://:0:0:0:0 | A-F | RegExpCharacterRange | | file://:0:0:0:0 | A-F | RegExpCharacterRange | @@ -41,20 +47,28 @@ term | file://:0:0:0:0 | F | RegExpConstant,RegExpNormalChar | | file://:0:0:0:0 | F | RegExpConstant,RegExpNormalChar | | file://:0:0:0:0 | F | RegExpConstant,RegExpNormalChar | +| file://:0:0:0:0 | F | RegExpConstant,RegExpNormalChar | | file://:0:0:0:0 | Z | RegExpConstant,RegExpNormalChar | | file://:0:0:0:0 | [ | RegExpConstant,RegExpNormalChar | | file://:0:0:0:0 | [ | RegExpConstant,RegExpNormalChar | +| file://:0:0:0:0 | [ | RegExpConstant,RegExpNormalChar | +| file://:0:0:0:0 | [ | RegExpConstant,RegExpNormalChar | +| file://:0:0:0:0 | [ | RegExpConstant,RegExpNormalChar | | file://:0:0:0:0 | [123] | RegExpCharacterClass | | file://:0:0:0:0 | [.a.] | RegExpPosixCollatingSymbol | | file://:0:0:0:0 | [.b.] | RegExpPosixCollatingSymbol | | file://:0:0:0:0 | [A-F[:digit:]a-f] | RegExpCharacterClass | | file://:0:0:0:0 | [A-F[[.b.]] | RegExpCharacterClass | | file://:0:0:0:0 | [A-F[[.b.]]a-f] | RegExpSequence | +| file://:0:0:0:0 | [A-F[[=b=] | RegExpCharacterClass | +| file://:0:0:0:0 | [A-F[[=b=]]a-f] | RegExpSequence | | file://:0:0:0:0 | [[.a.]] | RegExpCharacterClass | | file://:0:0:0:0 | [[:alpha:][:digit:]] | RegExpCharacterClass | | file://:0:0:0:0 | [[:alpha:]] | RegExpCharacterClass | | file://:0:0:0:0 | [[:alpha:]][[:digit:]] | RegExpSequence | | file://:0:0:0:0 | [[:digit:]] | RegExpCharacterClass | +| file://:0:0:0:0 | [[=a=] | RegExpCharacterClass | +| file://:0:0:0:0 | [[=a=]] | RegExpSequence | | file://:0:0:0:0 | [[a-f] | RegExpCharacterClass | | file://:0:0:0:0 | [[a-f]A-F] | RegExpSequence | | file://:0:0:0:0 | [\\0] | RegExpCharacterClass | @@ -100,6 +114,8 @@ term | file://:0:0:0:0 | \| | RegExpConstant,RegExpNormalChar | | file://:0:0:0:0 | ] | RegExpConstant,RegExpNormalChar | | file://:0:0:0:0 | ] | RegExpConstant,RegExpNormalChar | +| file://:0:0:0:0 | ] | RegExpConstant,RegExpNormalChar | +| file://:0:0:0:0 | ]a-f] | RegExpConstant,RegExpNormalChar | | file://:0:0:0:0 | _ | RegExpConstant,RegExpNormalChar | | file://:0:0:0:0 | a | RegExpConstant,RegExpNormalChar | | file://:0:0:0:0 | a | RegExpConstant,RegExpNormalChar | @@ -113,6 +129,7 @@ term | file://:0:0:0:0 | a | RegExpConstant,RegExpNormalChar | | file://:0:0:0:0 | a | RegExpConstant,RegExpNormalChar | | file://:0:0:0:0 | a | RegExpConstant,RegExpNormalChar | +| file://:0:0:0:0 | a | RegExpConstant,RegExpNormalChar | | file://:0:0:0:0 | a* | RegExpStar | | file://:0:0:0:0 | a*b+c?d | RegExpSequence | | file://:0:0:0:0 | a+ | RegExpPlus | @@ -145,6 +162,7 @@ term | file://:0:0:0:0 | b | RegExpConstant,RegExpNormalChar | | file://:0:0:0:0 | b | RegExpConstant,RegExpNormalChar | | file://:0:0:0:0 | b | RegExpConstant,RegExpNormalChar | +| file://:0:0:0:0 | b | RegExpConstant,RegExpNormalChar | | file://:0:0:0:0 | b+ | RegExpPlus | | file://:0:0:0:0 | b+ | RegExpPlus | | file://:0:0:0:0 | bar | RegExpConstant,RegExpNormalChar | @@ -174,6 +192,11 @@ regExpNormalCharValue | file://:0:0:0:0 | !a | !a | | file://:0:0:0:0 | - | - | | file://:0:0:0:0 | : | : | +| file://:0:0:0:0 | = | = | +| file://:0:0:0:0 | = | = | +| file://:0:0:0:0 | = | = | +| file://:0:0:0:0 | = | = | +| file://:0:0:0:0 | A | A | | file://:0:0:0:0 | A | A | | file://:0:0:0:0 | A | A | | file://:0:0:0:0 | A | A | @@ -182,9 +205,13 @@ regExpNormalCharValue | file://:0:0:0:0 | F | F | | file://:0:0:0:0 | F | F | | file://:0:0:0:0 | F | F | +| file://:0:0:0:0 | F | F | | file://:0:0:0:0 | Z | Z | | file://:0:0:0:0 | [ | [ | | file://:0:0:0:0 | [ | [ | +| file://:0:0:0:0 | [ | [ | +| file://:0:0:0:0 | [ | [ | +| file://:0:0:0:0 | [ | [ | | file://:0:0:0:0 | \\0 | 0 | | file://:0:0:0:0 | \\0 | 0 | | file://:0:0:0:0 | \\D | D | @@ -207,6 +234,8 @@ regExpNormalCharValue | file://:0:0:0:0 | \| | \| | | file://:0:0:0:0 | ] | ] | | file://:0:0:0:0 | ] | ] | +| file://:0:0:0:0 | ] | ] | +| file://:0:0:0:0 | ]a-f] | ]a-f] | | file://:0:0:0:0 | _ | _ | | file://:0:0:0:0 | a | a | | file://:0:0:0:0 | a | a | @@ -220,6 +249,7 @@ regExpNormalCharValue | file://:0:0:0:0 | a | a | | file://:0:0:0:0 | a | a | | file://:0:0:0:0 | a | a | +| file://:0:0:0:0 | a | a | | file://:0:0:0:0 | a-f] | a-f] | | file://:0:0:0:0 | abc | abc | | file://:0:0:0:0 | abc | abc | @@ -240,6 +270,7 @@ regExpNormalCharValue | file://:0:0:0:0 | b | b | | file://:0:0:0:0 | b | b | | file://:0:0:0:0 | b | b | +| file://:0:0:0:0 | b | b | | file://:0:0:0:0 | bar | bar | | file://:0:0:0:0 | bar | bar | | file://:0:0:0:0 | c | c |