X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/355cc1eb84453c116ec1b46baad03b7d5ba6d0da..1c3dd2c343420160ec2ce76357532f1bf93a5bda:/Cycript.l.in diff --git a/Cycript.l.in b/Cycript.l.in index 37707a6..58ed9fd 100644 --- a/Cycript.l.in +++ b/Cycript.l.in @@ -83,6 +83,12 @@ typedef cy::parser::token tk; yylloc->columns(yyleng); \ } +#define M { \ + if (yyextra->commented_) { \ + I(comment, Comment(Y), tk::Comment, hi::Comment); \ + } \ +} + int H(char c) { if (c >= '0' && c <= '9') return c - '0'; @@ -147,12 +153,12 @@ XMLName {XMLNameStart}{XMLNamePart}* \/{RegularExpressionBody}\/{RegularExpressionFlags} L C I(literal, RegEx(Y), tk::RegularExpressionLiteral, hi::Constant); -\/\/[^\n]* L +\/\/[^\n]* L M /* http://ostermiller.org/findcomment.html */ /* XXX: unify these two rules using !? */ \/\*!([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/ V() C I(comment, Comment(Y), tk::Comment, hi::Comment); -\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/ V(N) +\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/ V(N) M @begin E4X "<>" L F(tk::LeftRight, hi::Structure);