Skip to content

Commit

Permalink
Update the regex in escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
poorna2152 committed Oct 25, 2023
1 parent b1c4072 commit 34b6f71
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5478,7 +5478,8 @@ private BLangNode createActionOrExpression(Node actionOrExpression) {
BLangSimpleVarRef bLVarRef = (BLangSimpleVarRef) TreeBuilder.createSimpleVariableReferenceNode();
bLVarRef.pos = getPosition(actionOrExpression);
bLVarRef.pkgAlias = this.createIdentifier(nameReference[0].getPosition(), nameReference[0].getValue());
bLVarRef.variableName = this.createIdentifier(nameReference[1].getPosition(), nameReference[1].getValue());
bLVarRef.variableName =
this.createIdentifier(nameReference[1].getPosition(), nameReference[1].originalValue);
return bLVarRef;
} else if (actionOrExpression.kind() == SyntaxKind.BRACED_EXPRESSION) {
BLangGroupExpr group = (BLangGroupExpr) TreeBuilder.createGroupExpressionNode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private static String encodeIdentifier(String identifier) {
* @return a new unescaped {@code String}, {@code null} if null string input
*/
public static String unescapeJava(String str) {
String result = str.replaceAll("\\\\(\\d)", "$1");
String result = str.replaceAll("(?<!\\\\)\\\\(\\d)", "$1");
return StringEscapeUtils.unescapeJava(result);
}

Expand Down

0 comments on commit 34b6f71

Please sign in to comment.