]> git.saurik.com Git - cycript.git/blobdiff - Cycript.l.in
Rearrange who pulls WebKit from where.
[cycript.git] / Cycript.l.in
index 5b4d5d9cfbbc7da338cdb4f9979b5fbdfc4b6c96..bdd25ed31d661177c039b1f2b215f06b96124d27 100644 (file)
@@ -161,8 +161,11 @@ XMLName {XMLNameStart}{XMLNamePart}*
 <RegExp>\/{RegularExpressionBody}\/{RegularExpressionFlags} E("")
 
 \/\/[^\n]* L
-\/\*!(\n|[^\*]|\*[^/])*\*\/ V() C yylval->comment_ = new(yyextra->pool_) CYComment(apr_pstrmemdup(yyextra->pool_, yytext, yyleng)); return tk::Comment;
-\/\*(\n|[^\*]|\*[^/])*\*\/ V(N)
+
+       /* http://ostermiller.org/findcomment.html */
+       /* XXX: unify these two rules using !? */
+\/\*!([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/ V() C yylval->comment_ = new(yyextra->pool_) CYComment(apr_pstrmemdup(yyextra->pool_, yytext, yyleng)); return tk::Comment;
+\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/ V(N)
 
 @begin E4X
 <RegExp>"<>"      L return tk::LeftRight;
@@ -347,7 +350,7 @@ XMLName {XMLNameStart}{XMLNamePart}*
     char *value(reinterpret_cast<char *>(apr_palloc(yyextra->pool_, yyleng)));
     char *local(value);
 
-    for (size_t i(1); i != yyleng - 1; ++i) {
+    for (yy_size_t i(1), e(yyleng - 1); i != e; ++i) {
         char next(yytext[i]);
 
         if (yytext[i] == '\\')
@@ -381,7 +384,8 @@ XMLName {XMLNameStart}{XMLNamePart}*
 \r?\n yylloc->end.lines(); yylloc->step(); N
 
 [ \t] L
-<<EOF>> L yyterminate();
+
+<<EOF>> if (yyextra->auto_) { yyextra->auto_ = false; return tk::AutoComplete; } L yyterminate();
 
 . L {
     CYDriver::Error error;