Skip to content

Commit d9c3b4c

Browse files
committed
Redirect interp/eval/macro through eval/ParserUtil.hx
1 parent 7b566ef commit d9c3b4c

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

src/be/regex/ParserUtil.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package be.regex;
22

33
typedef ParserUtil =
44
#if (interp || eval || macro)
5-
be.regex.std.ParserUtil
5+
be.regex.eval.ParserUtil
66
#else
77
be.regex.expr.ParserUtil
88
#end;

src/be/regex/eval/ParserUtil.hx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package be.regex.eval;
2+
3+
import be.regex.Define;
4+
import haxe.macro.Expr;
5+
import haxe.macro.Context;
6+
7+
class ParserUtil {
8+
9+
private static var pythonStyle:Bool = Python; // \uHHHH or \UHHHHHHHH
10+
private static var perlStyle:Bool = Neko || Cpp || Php || Lua || Java; // \x{HHHH}
11+
private static var jsStyle:Bool = JavaScript || CSharp || Flash; // \uHHHH
12+
private static var onlyBMP:Bool = JavaScript || CSharp;
13+
14+
public static function pattern(s:String):String {
15+
return be.regex.std.ParserUtil.pattern(s, perlStyle, jsStyle, onlyBMP);
16+
}
17+
18+
public static function category(c:String):String {
19+
return be.regex.std.ParserUtil.category(c, pythonStyle, perlStyle, jsStyle, onlyBMP);
20+
}
21+
22+
}

0 commit comments

Comments
 (0)