From e46761272105b911e12186212afa6e9373ff9641 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Fri, 21 Oct 2011 10:18:27 +0000 Subject: [PATCH] Ported back to cygwin. --- Console.cpp | 2 +- Cycript.l.in | 10 ++-------- Parser.hpp | 1 + Replace.cpp | 3 +++ 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Console.cpp b/Console.cpp index 50692f2..c680947 100644 --- a/Console.cpp +++ b/Console.cpp @@ -573,7 +573,7 @@ int Main(int argc, char const * const argv[], char const * const envp[]) { bool compile(false); CYOptions options; - append_history$ = reinterpret_cast(dlsym(RTLD_DEFAULT, "append_history")); + append_history$ = (int (*)(int, const char *)) (dlsym(RTLD_DEFAULT, "append_history")); #ifdef CY_ATTACH pid_t pid(_not(pid_t)); diff --git a/Cycript.l.in b/Cycript.l.in index c6ff5ab..f97158e 100644 --- a/Cycript.l.in +++ b/Cycript.l.in @@ -40,13 +40,7 @@ typedef cy::parser::token tk; #define C T yyextra->state_ = CYClear; #define R T yyextra->state_ = CYRestricted; -#define E(prefix) L C { \ - char *value(A char[yyleng + sizeof(prefix)]); \ - memcpy(value, prefix, sizeof(prefix) - 1); \ - memcpy(value + sizeof(prefix) - 1, yytext, yyleng); \ - value[yyleng + sizeof(prefix) - 1] = '\0'; \ - I(literal, RegEx(value), RegularExpressionLiteral); \ -} +#define E L C I(literal, RegEx(Y), RegularExpressionLiteral); #define N \ if (yyextra->state_ != CYNewLine) { \ @@ -147,7 +141,7 @@ XMLName {XMLNameStart}{XMLNamePart}* %% -\/{RegularExpressionBody}\/{RegularExpressionFlags} E("") +\/{RegularExpressionBody}\/{RegularExpressionFlags} E \/\/[^\n]* L diff --git a/Parser.hpp b/Parser.hpp index aad1d47..b126d5a 100644 --- a/Parser.hpp +++ b/Parser.hpp @@ -303,6 +303,7 @@ struct CYScope { CYIdentifierValueSet identifiers_; CYScope(CYScopeType type, CYContext &context, CYStatement *&statements); + virtual ~CYScope(); void Close(); diff --git a/Replace.cpp b/Replace.cpp index 5803478..e6b761f 100644 --- a/Replace.cpp +++ b/Replace.cpp @@ -621,6 +621,9 @@ CYScope::CYScope(CYScopeType type, CYContext &context, CYStatement *&statements) context_.scope_ = this; } +CYScope::~CYScope() { +} + void CYScope::Close() { context_.scope_ = parent_; Scope(context_, statements_); -- 2.47.2