aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/genksyms/lex.lex.c_shipped
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/genksyms/lex.lex.c_shipped')
-rw-r--r--scripts/genksyms/lex.lex.c_shipped51
1 files changed, 49 insertions, 2 deletions
diff --git a/scripts/genksyms/lex.lex.c_shipped b/scripts/genksyms/lex.lex.c_shipped
index 0bf4157e6161..f82740a69b85 100644
--- a/scripts/genksyms/lex.lex.c_shipped
+++ b/scripts/genksyms/lex.lex.c_shipped
@@ -1938,8 +1938,9 @@ int
1938yylex(void) 1938yylex(void)
1939{ 1939{
1940 static enum { 1940 static enum {
1941 ST_NOTSTARTED, ST_NORMAL, ST_ATTRIBUTE, ST_ASM, ST_BRACKET, ST_BRACE, 1941 ST_NOTSTARTED, ST_NORMAL, ST_ATTRIBUTE, ST_ASM, ST_TYPEOF, ST_TYPEOF_1,
1942 ST_EXPRESSION, ST_TABLE_1, ST_TABLE_2, ST_TABLE_3, ST_TABLE_4, 1942 ST_BRACKET, ST_BRACE, ST_EXPRESSION,
1943 ST_TABLE_1, ST_TABLE_2, ST_TABLE_3, ST_TABLE_4,
1943 ST_TABLE_5, ST_TABLE_6 1944 ST_TABLE_5, ST_TABLE_6
1944 } lexstate = ST_NOTSTARTED; 1945 } lexstate = ST_NOTSTARTED;
1945 1946
@@ -2007,6 +2008,10 @@ repeat:
2007 lexstate = ST_ASM; 2008 lexstate = ST_ASM;
2008 count = 0; 2009 count = 0;
2009 goto repeat; 2010 goto repeat;
2011 case TYPEOF_KEYW:
2012 lexstate = ST_TYPEOF;
2013 count = 0;
2014 goto repeat;
2010 2015
2011 case STRUCT_KEYW: 2016 case STRUCT_KEYW:
2012 case UNION_KEYW: 2017 case UNION_KEYW:
@@ -2093,6 +2098,48 @@ repeat:
2093 } 2098 }
2094 break; 2099 break;
2095 2100
2101 case ST_TYPEOF:
2102 switch (token)
2103 {
2104 case '(':
2105 if ( ++count == 1 )
2106 lexstate = ST_TYPEOF_1;
2107 else
2108 APP;
2109 goto repeat;
2110 case ')':
2111 APP;
2112 if (--count == 0)
2113 {
2114 lexstate = ST_NORMAL;
2115 token = TYPEOF_PHRASE;
2116 break;
2117 }
2118 goto repeat;
2119 default:
2120 APP;
2121 goto repeat;
2122 }
2123 break;
2124
2125 case ST_TYPEOF_1:
2126 if (token == IDENT)
2127 {
2128 if (is_reserved_word(yytext, yyleng)
2129 || find_symbol(yytext, SYM_TYPEDEF, 1))
2130 {
2131 yyless(0);
2132 unput('(');
2133 lexstate = ST_NORMAL;
2134 token = TYPEOF_KEYW;
2135 break;
2136 }
2137 _APP("(", 1);
2138 }
2139 APP;
2140 lexstate = ST_TYPEOF;
2141 goto repeat;
2142
2096 case ST_BRACKET: 2143 case ST_BRACKET:
2097 APP; 2144 APP;
2098 switch (token) 2145 switch (token)