Skip to content
This repository was archived by the owner on Dec 31, 2024. It is now read-only.

Commit af31b1a

Browse files
committed
fix: several small fixes
1 parent f885d43 commit af31b1a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/me/topchetoeu/jscript/lib/RegExpLib.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import java.util.ArrayList;
44
import java.util.Iterator;
5-
import java.util.function.Function;
65
import java.util.regex.Pattern;
76

87
import me.topchetoeu.jscript.engine.Context;
@@ -290,6 +289,7 @@ public RegExpLib(String pattern, String flags) {
290289
if (flags.contains("s")) this.flags |= Pattern.DOTALL;
291290
if (flags.contains("u")) this.flags |= Pattern.UNICODE_CHARACTER_CLASS;
292291

292+
if (pattern.equals("{(\\d+)}")) pattern = "\\{([0-9]+)\\}";
293293
this.pattern = Pattern.compile(pattern.replace("\\d", "[0-9]"), this.flags);
294294

295295
var matcher = NAMED_PATTERN.matcher(source);

src/me/topchetoeu/jscript/parsing/Parsing.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ else if (!isDigit(c)) {
257257
}
258258
break;
259259
case CURR_LITERAL:
260-
if (isAlphanumeric(c) || c == '_') {
260+
if (isAlphanumeric(c) || c == '_' || c == '$') {
261261
currToken.append(c);
262262
continue;
263263
}

0 commit comments

Comments
 (0)