Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: src/token.h

Issue 6246064: Issue 117 - strict mode and future reserved words (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address code review comments Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/scanner-base.cc ('k') | test/mjsunit/strict-mode.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 K(SWITCH, "switch", 0) \ 148 K(SWITCH, "switch", 0) \
149 K(THIS, "this", 0) \ 149 K(THIS, "this", 0) \
150 K(THROW, "throw", 0) \ 150 K(THROW, "throw", 0) \
151 K(TRY, "try", 0) \ 151 K(TRY, "try", 0) \
152 /* TYPEOF */ \ 152 /* TYPEOF */ \
153 K(VAR, "var", 0) \ 153 K(VAR, "var", 0) \
154 /* VOID */ \ 154 /* VOID */ \
155 K(WHILE, "while", 0) \ 155 K(WHILE, "while", 0) \
156 K(WITH, "with", 0) \ 156 K(WITH, "with", 0) \
157 \ 157 \
158 /* Future reserved words (ECMA-262, section 7.5.3, page 14). */ \
159 F(ABSTRACT, "abstract", 0) \
160 F(BOOLEAN, "boolean", 0) \
161 F(BYTE, "byte", 0) \
162 F(CHAR, "char", 0) \
163 F(CLASS, "class", 0) \
164 K(CONST, "const", 0) \
165 F(DOUBLE, "double", 0) \
166 F(ENUM, "enum", 0) \
167 F(EXPORT, "export", 0) \
168 F(EXTENDS, "extends", 0) \
169 F(FINAL, "final", 0) \
170 F(FLOAT, "float", 0) \
171 F(GOTO, "goto", 0) \
172 F(IMPLEMENTS, "implements", 0) \
173 F(IMPORT, "import", 0) \
174 F(INT, "int", 0) \
175 F(INTERFACE, "interface", 0) \
176 F(LONG, "long", 0) \
177 K(NATIVE, "native", 0) \
178 F(PACKAGE, "package", 0) \
179 F(PRIVATE, "private", 0) \
180 F(PROTECTED, "protected", 0) \
181 F(PUBLIC, "public", 0) \
182 F(SHORT, "short", 0) \
183 F(STATIC, "static", 0) \
184 F(SUPER, "super", 0) \
185 F(SYNCHRONIZED, "synchronized", 0) \
186 F(THROWS, "throws", 0) \
187 F(TRANSIENT, "transient", 0) \
188 F(VOLATILE, "volatile", 0) \
189 \
190 /* Literals (ECMA-262, section 7.8, page 16). */ \ 158 /* Literals (ECMA-262, section 7.8, page 16). */ \
191 K(NULL_LITERAL, "null", 0) \ 159 K(NULL_LITERAL, "null", 0) \
192 K(TRUE_LITERAL, "true", 0) \ 160 K(TRUE_LITERAL, "true", 0) \
193 K(FALSE_LITERAL, "false", 0) \ 161 K(FALSE_LITERAL, "false", 0) \
194 T(NUMBER, NULL, 0) \ 162 T(NUMBER, NULL, 0) \
195 T(STRING, NULL, 0) \ 163 T(STRING, NULL, 0) \
196 \ 164 \
197 /* Identifiers (not keywords or future reserved words). */ \ 165 /* Identifiers (not keywords or future reserved words). */ \
198 T(IDENTIFIER, NULL, 0) \ 166 T(IDENTIFIER, NULL, 0) \
199 \ 167 \
168 /* Future reserved words (ECMA-262, section 7.6.1.2). */ \
169 T(FUTURE_RESERVED_WORD, NULL, 0) \
170 K(CONST, "const", 0) \
171 K(NATIVE, "native", 0) \
172 \
200 /* Illegal token - not able to scan. */ \ 173 /* Illegal token - not able to scan. */ \
201 T(ILLEGAL, "ILLEGAL", 0) \ 174 T(ILLEGAL, "ILLEGAL", 0) \
202 \ 175 \
203 /* Scanner-internal use only. */ \ 176 /* Scanner-internal use only. */ \
204 T(WHITESPACE, NULL, 0) 177 T(WHITESPACE, NULL, 0)
205 178
206 179
207 class Token { 180 class Token {
208 public: 181 public:
209 // All token values. 182 // All token values.
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 private: 279 private:
307 static const char* name_[NUM_TOKENS]; 280 static const char* name_[NUM_TOKENS];
308 static const char* string_[NUM_TOKENS]; 281 static const char* string_[NUM_TOKENS];
309 static int8_t precedence_[NUM_TOKENS]; 282 static int8_t precedence_[NUM_TOKENS];
310 static const char token_type[NUM_TOKENS]; 283 static const char token_type[NUM_TOKENS];
311 }; 284 };
312 285
313 } } // namespace v8::internal 286 } } // namespace v8::internal
314 287
315 #endif // V8_TOKEN_H_ 288 #endif // V8_TOKEN_H_
OLDNEW
« no previous file with comments | « src/scanner-base.cc ('k') | test/mjsunit/strict-mode.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698