From 3cc3e14d8539cef545aa57f3b1a3499c0d3fdf1b Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Fri, 8 Jan 2016 20:37:14 -0800 Subject: [PATCH 1/1] We no longer need to support the restrict keyword. --- Parser.ypp.in | 28 ++-------------------------- Scanner.lpp.in | 2 -- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/Parser.ypp.in b/Parser.ypp.in index d608263..547d93e 100644 --- a/Parser.ypp.in +++ b/Parser.ypp.in @@ -443,8 +443,6 @@ type; }) %token ___proto___ "__proto__" %token _prototype_ "prototype" %token _public_ "public" -%token ___restrict_ "__restrict" -%token _restrict_ "restrict" %token _set_ "set" %token _short_ "short" %token _static_ "static" @@ -1032,8 +1030,6 @@ IdentifierNoOf | "int" { $$ = CYNew CYIdentifier("int"); } | "__int128" { $$ = CYNew CYIdentifier("__int128"); } | "long" { $$ = CYNew CYIdentifier("long"); } - | "__restrict" { $$ = CYNew CYIdentifier("__restrict"); } - | "restrict" { $$ = CYNew CYIdentifier("restrict"); } | "short" { $$ = CYNew CYIdentifier("short"); } | "static" { $$ = CYNew CYIdentifier("static"); } | "volatile" { $$ = CYNew CYIdentifier("volatile"); } @@ -2044,31 +2040,12 @@ TypeSignifierOpt | TypeSignifierNone[pass] { $$ = $pass; } ; -Restrict - : "__restrict" - | "restrict" - ; - -RestrictOpt - : Restrict - | - ; - -ParameterModifier - : "throw" "(" ")" - ; - -ParameterModifierOpt - : ParameterModifier - | - ; - ParameterTail - : TypedParameterListOpt[formal] ")" ParameterModifierOpt { $$ = CYNew CYTypeFunctionWith($formal->variadic_, $formal->parameters_); } + : TypedParameterListOpt[formal] ")" { $$ = CYNew CYTypeFunctionWith($formal->variadic_, $formal->parameters_); } ; SuffixedType - : SuffixedTypeOpt[typed] "[" RestrictOpt NumericLiteral[size] "]" { $$ = $typed; $$->modifier_ = CYNew CYTypeArrayOf($size, $$->modifier_); } + : SuffixedTypeOpt[typed] "[" NumericLiteral[size] "]" { $$ = $typed; $$->modifier_ = CYNew CYTypeArrayOf($size, $$->modifier_); } | "(" "^" TypeQualifierRightOpt[typed] ")" "(" TypedParameters[parameters] ")" { $$ = $typed; $$->modifier_ = CYNew CYTypeBlockWith($parameters, $$->modifier_); } | TypeSignifier[typed] "(" ParameterTail[modifier] { $$ = $typed; CYSetLast($modifier) = $$->modifier_; $$->modifier_ = $modifier; } | "("[parenthesis] ParameterTail[modifier] { $$ = CYNew CYTypedName(@parenthesis); CYSetLast($modifier) = $$->modifier_; $$->modifier_ = $modifier; } @@ -2098,7 +2075,6 @@ TypeQualifierRight | PrefixedType[pass] { $$ = $pass; } | "const" TypeQualifierRightOpt[typed] { $$ = $typed; $$->modifier_ = CYNew CYTypeConstant($$->modifier_); } | "volatile" TypeQualifierRightOpt[typed] { $$ = $typed; $$->modifier_ = CYNew CYTypeVolatile($$->modifier_); } - | Restrict TypeQualifierRightOpt[typed] { $$ = $typed; } ; TypeQualifierRightOpt diff --git a/Scanner.lpp.in b/Scanner.lpp.in index d9614df..e16900a 100644 --- a/Scanner.lpp.in +++ b/Scanner.lpp.in @@ -495,8 +495,6 @@ XMLName {XMLNameStart}{XMLNamePart}* "__proto__" L /*III*/ F(tk::___proto___, hi::Special); "prototype" L /*III*/ F(tk::_prototype_, hi::Special); "public" L /*FSS*/ F(tk::_public_, hi::Meta); -"__restrict" L /*III*/ F(tk::___restrict_, hi::Meta); -"restrict" L /*III*/ F(tk::_restrict_, hi::Meta); "return" L /*KKK*/ F(tk::_return_, hi::Control); "set" L /*III*/ F(tk::_set_, hi::Meta); "short" L /*FII*/ F(tk::_short_, hi::Type); -- 2.47.2