Index: src/js/macros.py |
diff --git a/src/js/macros.py b/src/js/macros.py |
index 856158aa898e6b509eb7fd7b0afc2036b497c149..6ea32f41d0235e9cc3d9067810967aca815af2b3 100644 |
--- a/src/js/macros.py |
+++ b/src/js/macros.py |
@@ -178,6 +178,13 @@ python macro CHAR_CODE(str) = ord(str[1]); |
define REGEXP_NUMBER_OF_CAPTURES = 0; |
define REGEXP_FIRST_CAPTURE = 3; |
+macro REGEXP_GLOBAL(regexp) = (regexp[regExpFlagsSymbol] & 1); |
Dan Ehrenberg
2015/11/02 19:21:06
Can you define constants for these numbers like 1,
Yang
2015/11/02 20:51:08
Isnt the point of macros.py to contain those const
|
+macro REGEXP_IGNORE_CASE(regexp) = (regexp[regExpFlagsSymbol] & 2); |
+macro REGEXP_MULTILINE(regexp) = (regexp[regExpFlagsSymbol] & 4); |
+macro REGEXP_STICKY(regexp) = (regexp[regExpFlagsSymbol] & 8); |
+macro REGEXP_UNICODE(regexp) = (regexp[regExpFlagsSymbol] & 16); |
+macro REGEXP_SOURCE(regexp) = (regexp[regExpSourceSymbol]); |
+ |
# We can't put macros in macros so we use constants here. |
# REGEXP_NUMBER_OF_CAPTURES |
macro NUMBER_OF_CAPTURES(array) = ((array)[0]); |