From 39ed6a515508c195281495054579ab82f30545e8 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Wed, 12 Jun 2013 00:03:14 -0700 Subject: [PATCH] Improve isolation of ObjectiveC syntax filter code. --- Cycript.l.in | 2 ++ Cycript.yy.in | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Cycript.l.in b/Cycript.l.in index 0397b14..ea140a8 100644 --- a/Cycript.l.in +++ b/Cycript.l.in @@ -33,7 +33,9 @@ typedef cy::parser::token tk; // do /not/ fold token to the return: this is a macro and the ordering is dependent #define F(value, highlight) do { \ int token(value); \ +@begin ObjectiveC yyextra->no_.AtImplementation = false; \ +@end yyextra->no_.Function = false; \ yyextra->no_.OpenBrace = false; \ yylval->highlight_ = highlight; \ diff --git a/Cycript.yy.in b/Cycript.yy.in index aab5160..62cdca2 100644 --- a/Cycript.yy.in +++ b/Cycript.yy.in @@ -81,9 +81,6 @@ typedef struct { CYString *string_; CYThis *this_; CYTrue *true_; - CYTypeModifier *type_; - CYTypedIdentifier *typedIdentifier_; - CYTypedParameter *typedParameter_; CYWord *word_; @begin ObjectiveC @@ -93,6 +90,9 @@ typedef struct { CYMessageParameter *messageParameter_; CYProtocol *protocol_; CYSelectorPart *selector_; + CYTypeModifier *type_; + CYTypedIdentifier *typedIdentifier_; + CYTypedParameter *typedParameter_; @end @begin E4X @@ -557,8 +557,10 @@ LexNoFunction : { if (yychar == yyempty_) driver.no_.Function = true; else if (yychar == token::Function) yychar = token::Function_; } ; -LexNoAtImplementation - : { if (yychar == yyempty_) driver.no_.AtImplementation = true; else if (yychar == token::AtImplementation) yychar = token::AtImplementation_; } +LexNoAtImplementation : +@begin ObjectiveC + { if (yychar == yyempty_) driver.no_.AtImplementation = true; else if (yychar == token::AtImplementation) yychar = token::AtImplementation_; } +@end ; LexSetStatement -- 2.47.2