]> git.saurik.com Git - cycript.git/commitdiff
Fix multi-line comments that end with **/.
authorJay Freeman (saurik) <saurik@saurik.com>
Sun, 25 Apr 2010 23:30:27 +0000 (23:30 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Sun, 25 Apr 2010 23:30:27 +0000 (23:30 +0000)
Cycript.l.in

index 70d4e5377c7438e423c13f7d7a162dfd65713f36..e08523340643a4c32031ddd7f19cff782e736b96 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;