]> git.saurik.com Git - cycript.git/blobdiff - Cycript.l.in
Worked around the bug in flex 2.5.35 that causes yy_size_t/int comparison warnings.
[cycript.git] / Cycript.l.in
index 0a9bbda388e5bf85864e63f376af13da29bb0a6e..70d4e5377c7438e423c13f7d7a162dfd65713f36 100644 (file)
@@ -107,7 +107,8 @@ int H(char c) {
     } else if (yyextra->size_ == 0) \
         value = YY_NULL; \
     else { \
-        size_t copy(std::min(size, yyextra->size_)); \
+        size_t copy(size); \
+        copy = (std::min(copy, yyextra->size_)); \
         memcpy(data, yyextra->data_, copy); \
         yyextra->data_ += copy; \
         yyextra->size_ -= copy; \
@@ -160,6 +161,7 @@ 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)
 
 @begin E4X
@@ -338,14 +340,14 @@ XMLName {XMLNameStart}{XMLNamePart}*
 (\.[0-9]+|(0|[1-9][0-9]*)(\.[0-9]*)?){Exponent}? L C yylval->number_ = new(yyextra->pool_) CYNumber(strtod(yytext, NULL)); return tk::NumericLiteral;
 
 0[xX][0-9a-fA-F]+ L C yylval->number_ = new(yyextra->pool_) CYNumber(strtoull(yytext + 2, NULL, 16)); return tk::NumericLiteral;
-
+0[0-7]+ L C yylval->number_ = new(yyextra->pool_) CYNumber(strtoull(yytext + 1, NULL, 8)); return tk::NumericLiteral;
 0[bB][0-1]+ L C yylval->number_ = new(yyextra->pool_) CYNumber(strtoull(yytext + 2, NULL, 2)); return tk::NumericLiteral;
 
 \"([^"\\\n]|{Escape})*\"|'([^'\\\n]|{Escape})*' L C {
     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] == '\\')