Skip to content

Commit

Permalink
corrected handling of IdentityEscape
Browse files Browse the repository at this point in the history
  • Loading branch information
pruemmer committed Jan 12, 2023
1 parent 9de37d3 commit fa81324
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions PP-patch
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
> private static void pp(Double d, int _i_) { buf_.append(d); }
> private static void pp(String s, int _i_) { buf_.append(s); }
> private static void pp(Character c, int _i_) { buf_.append("'" + c.toString() + "'"); }
3492,3495d3445
3892,3895d3845
< while (buf_.length() > 0 && buf_.charAt(0) == ' ')
< buf_.deleteCharAt(0);
< buf_.deleteCharAt(0);
< while (buf_.length() > 0 && buf_.charAt(buf_.length()-1) == ' ')
< buf_.deleteCharAt(buf_.length()-1);
3 changes: 2 additions & 1 deletion build-publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ make ecma2020regex/Yylex.java ecma2020regex/sym.java ecma2020regex/parser.java
patch ecma2020regex/PrettyPrinter.java PP-patch
sed 's/PrettyPrinter/PrettyPrinterNonStatic/g' <ecma2020regex/PrettyPrinter.java | sed 's/static//g' >ecma2020regex/PrettyPrinterNonStatic.java

mvn deploy
#mvn deploy
mvn package
7 changes: 6 additions & 1 deletion ecma2020regex.cf
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,9 @@ CodepointUniEscapeSequence. RegExpUnicodeEscapeSequenceC ::=

SyntaxIdentifyEscape. IdentityEscapeC ::= SyntaxCharacter;
NormalCharIdentifyEscape. IdentityEscapeC ::= ExtraNormalChar;
SpecialNormalIdentityEscape. IdentityEscapeC ::= SpecialNormalChar;
UnderscoreIdentityEscape. IdentityEscapeC ::= "_";
DashIdentityEscape. IdentityEscapeC ::= "-";
-- DecimalDigitIdentifyEscape. IdentityEscapeC ::= DecimalDigit;

-- DecimalEscape::
Expand Down Expand Up @@ -446,10 +449,12 @@ ClassAtomNoDashNeg4. ClassAtomNoDashNegC ::= "\\" ClassEscapeC;
-- CharacterEscape[?U]

BClassEscape. ClassEscapeC ::= "b";
DashClassEscape. ClassEscapeC ::= "-";
CCEClassEscape. ClassEscapeC ::= CharacterClassEscapeC;
CEClassEscapeCE. ClassEscapeC ::= CharacterEscapeC;

-- Already handled in CharacterEscapeC
-- DashClassEscape. ClassEscapeC ::= "-";

-- An as extension, we also handle octal escape strings within character classes
--
-- TODO: octal sequences should only be accepted for the range [0, 255]
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>uuverifiers</groupId>
<artifactId>ecma2020-regex-parser</artifactId>
<version>0.6</version>
<version>0.7</version>
<packaging>jar</packaging>

<name>ecma2020-regex-parser</name>
Expand Down
Binary file removed target/ecma2020-regex-parser-0.6.jar
Binary file not shown.
Binary file added target/ecma2020-regex-parser-0.7.jar
Binary file not shown.

0 comments on commit fa81324

Please sign in to comment.