]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - KeywordLookupGenerator.py
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / KeywordLookupGenerator.py
index 17bcc2d6ed1439b920c4ab9b01060918d8fdd533..d13daba61d24758b0a062a9695a1e1825094c46e 100644 (file)
@@ -141,7 +141,7 @@ class Trie:
         str = makePadding(indent)
 
         if self.value != None:
-            print(str + "if (!isIdentPart(code[%d])) {" % (len(self.fullPrefix)))
+            print(str + "if (!isIdentPartIncludingEscape(code+%d, m_codeEnd)) {" % (len(self.fullPrefix)))
             print(str + "    internalShift<%d>();" % len(self.fullPrefix))
             print(str + "    if (shouldCreateIdentifier)")
             print(str + ("        data->ident = &m_vm->propertyNames->%sKeyword;" % self.fullPrefix))
@@ -184,8 +184,8 @@ class Trie:
     def printAsC(self):
         print("namespace JSC {")
         print("")
-        print("static ALWAYS_INLINE bool isIdentPart(LChar c);")
-        print("static ALWAYS_INLINE bool isIdentPart(UChar c);")
+        print("static ALWAYS_INLINE bool isIdentPartIncludingEscape(const LChar* code, const LChar* codeEnd);")
+        print("static ALWAYS_INLINE bool isIdentPartIncludingEscape(const UChar* code, const UChar* codeEnd);")
         # max length + 1 so we don't need to do any bounds checking at all
         print("static const int maxTokenLength = %d;" % (self.maxLength() + 1))
         print("")