Skip to content

Commit

Permalink
Merge branch 'release/3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
jtnelson committed Mar 10, 2022
2 parents 52aeb08 + 3374494 commit 086d980
Show file tree
Hide file tree
Showing 7 changed files with 444 additions and 287 deletions.
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.1
3.1.2
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

#### Version 3.1.2 (TBD)
* Fixed a regression that caused parenthetical expressions within a `Condition` containing `LIKE` `REGEX`, `NOT_LIKE` and `NOT_REGEX` operators (e.g., `a = b and (email regex email.com)`) to mistakenly throw a `SyntaxException` when being parsed by a `Compiler`.

#### Version 3.1.1 (March 4, 2022)
* Fixed a regression that caused Conditions with `LIKE` `REGEX`, `NOT_LIKE` and `NOT_REGEX` operators followed by a whitespace containing value to be incorrectly parsed.

Expand Down
17 changes: 16 additions & 1 deletion grammar/grammar.jjt
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,24 @@ ValueTokenSymbol RegexValue() :
{
Token word;
String value = "";

}
{
(LOOKAHEAD(3) (word=<SIGNED_INTEGER> | word=<SIGNED_DECIMAL> | word=<NUMERIC> | word=<ALPHANUMERIC> | word=<NON_ALPHANUMERIC_AND_ALPHANUMERIC> | word=<PERIOD_SEPARATED_STRING> | word="(" | word=")" | word="_" | word="=")
<OPEN_PARENTHESES> (LOOKAHEAD(4) (word=<SIGNED_INTEGER> | word=<SIGNED_DECIMAL> | word=<NUMERIC> | word=<ALPHANUMERIC> | word=<NON_ALPHANUMERIC_AND_ALPHANUMERIC> | word=<PERIOD_SEPARATED_STRING> | word="_" | word="=")
{
if (value.equals("") |
value.endsWith("(") | word.image.equals(")") |
value.endsWith("=") | word.image.equals("=") |
value.endsWith("_") | word.image.equals("_")) {
value += word.image;
}
else {
value += " " + word.image;
}
})+ <CLOSE_PARENTHESES>
{ return new ValueSymbol(transformValue("(" + value + ")")); }
|
(LOOKAHEAD(3) (word=<SIGNED_INTEGER> | word=<SIGNED_DECIMAL> | word=<NUMERIC> | word=<ALPHANUMERIC> | word=<NON_ALPHANUMERIC_AND_ALPHANUMERIC> | word=<PERIOD_SEPARATED_STRING> | word="_" | word="=")
{
if (value.equals("") |
value.endsWith("(") | word.image.equals(")") |
Expand Down
Loading

0 comments on commit 086d980

Please sign in to comment.