mirror of
https://github.com/github/codeql.git
synced 2026-04-22 07:15:15 +02:00
Exposed flags to the regex parser
This commit is contained in:
@@ -67,6 +67,7 @@ public class RegExpParser {
|
||||
private List<Error> errors;
|
||||
private List<BackReference> backrefs;
|
||||
private int maxbackref;
|
||||
private String flags;
|
||||
|
||||
/** Parse the given string as a regular expression. */
|
||||
public Result parse(String src) {
|
||||
@@ -82,6 +83,11 @@ public class RegExpParser {
|
||||
return new Result(root, errors);
|
||||
}
|
||||
|
||||
public Result parse(String src, String flags) {
|
||||
this.flags = flags;
|
||||
return parse(src);
|
||||
}
|
||||
|
||||
private static String fromCodePoint(int codepoint) {
|
||||
if (Character.isValidCodePoint(codepoint)) return new String(Character.toChars(codepoint));
|
||||
// replacement character
|
||||
|
||||
Reference in New Issue
Block a user