]> git.saurik.com Git - cycript.git/blobdiff - Cycript.l.in
Universal binary!
[cycript.git] / Cycript.l.in
index 42ba069501d90e5f919a60075b36ee5fa7220c73..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 (int 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;