X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/d15b59f5d4f43d12719c5ce37518246058b405c6..35fa52c0744c970af2daa3c494f21bbe55aec536:/Cycript.l.in diff --git a/Cycript.l.in b/Cycript.l.in index cb2871d..42ba069 100644 --- a/Cycript.l.in +++ b/Cycript.l.in @@ -37,7 +37,7 @@ */ /* }}} */ -// XXX: supposedly I will be screwed on very very long multi-line comments and need to replace these with a manual lexer. http://websrv.cs.fsu.edu/~engelen/courses/COP5621/Pr2.pdf +/* XXX: supposedly I will be screwed on very very long multi-line comments and need to replace these with a manual lexer. http://websrv.cs.fsu.edu/~engelen/courses/COP5621/Pr2.pdf */ %{ #define YYLTYPE cy::location @@ -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}* \/{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 @@ -188,11 +190,14 @@ XMLName {XMLNameStart}{XMLNamePart}* @end @begin E4X -"@" L C return tk::At; "::" L C return tk::ColonColon; ".." L C return tk::PeriodPeriod; @end +@begin E4X ObjectiveC +"@" L C return tk::At; +@end + "&" L C return tk::Ampersand; "&&" L C return tk::AmpersandAmpersand; "&=" L C return tk::AmpersandEqual; @@ -335,7 +340,7 @@ 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 {