michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: * vim: set ts=8 sts=4 et sw=4 tw=99: michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* A higher-order macro for enumerating keyword tokens. */ michael@0: michael@0: #ifndef vm_Keywords_h michael@0: #define vm_Keywords_h michael@0: michael@0: #define FOR_EACH_JAVASCRIPT_KEYWORD(macro) \ michael@0: macro(false, false_, TOK_FALSE, JSVERSION_DEFAULT) \ michael@0: macro(true, true_, TOK_TRUE, JSVERSION_DEFAULT) \ michael@0: macro(null, null, TOK_NULL, JSVERSION_DEFAULT) \ michael@0: /* Keywords. */ \ michael@0: macro(break, break_, TOK_BREAK, JSVERSION_DEFAULT) \ michael@0: macro(case, case_, TOK_CASE, JSVERSION_DEFAULT) \ michael@0: macro(catch, catch_, TOK_CATCH, JSVERSION_DEFAULT) \ michael@0: macro(const, const_, TOK_CONST, JSVERSION_DEFAULT) \ michael@0: macro(continue, continue_, TOK_CONTINUE, JSVERSION_DEFAULT) \ michael@0: macro(debugger, debugger, TOK_DEBUGGER, JSVERSION_DEFAULT) \ michael@0: macro(default, default_, TOK_DEFAULT, JSVERSION_DEFAULT) \ michael@0: macro(delete, delete_, TOK_DELETE, JSVERSION_DEFAULT) \ michael@0: macro(do, do_, TOK_DO, JSVERSION_DEFAULT) \ michael@0: macro(else, else_, TOK_ELSE, JSVERSION_DEFAULT) \ michael@0: macro(finally, finally_, TOK_FINALLY, JSVERSION_DEFAULT) \ michael@0: macro(for, for_, TOK_FOR, JSVERSION_DEFAULT) \ michael@0: macro(function, function, TOK_FUNCTION, JSVERSION_DEFAULT) \ michael@0: macro(if, if_, TOK_IF, JSVERSION_DEFAULT) \ michael@0: macro(in, in, TOK_IN, JSVERSION_DEFAULT) \ michael@0: macro(instanceof, instanceof, TOK_INSTANCEOF, JSVERSION_DEFAULT) \ michael@0: macro(new, new_, TOK_NEW, JSVERSION_DEFAULT) \ michael@0: macro(return, return_, TOK_RETURN, JSVERSION_DEFAULT) \ michael@0: macro(switch, switch_, TOK_SWITCH, JSVERSION_DEFAULT) \ michael@0: macro(this, this_, TOK_THIS, JSVERSION_DEFAULT) \ michael@0: macro(throw, throw_, TOK_THROW, JSVERSION_DEFAULT) \ michael@0: macro(try, try_, TOK_TRY, JSVERSION_DEFAULT) \ michael@0: macro(typeof, typeof, TOK_TYPEOF, JSVERSION_DEFAULT) \ michael@0: macro(var, var, TOK_VAR, JSVERSION_DEFAULT) \ michael@0: macro(void, void_, TOK_VOID, JSVERSION_DEFAULT) \ michael@0: macro(while, while_, TOK_WHILE, JSVERSION_DEFAULT) \ michael@0: macro(with, with, TOK_WITH, JSVERSION_DEFAULT) \ michael@0: macro(import, import, TOK_IMPORT, JSVERSION_DEFAULT) \ michael@0: macro(export, export, TOK_EXPORT, JSVERSION_DEFAULT) \ michael@0: /* Reserved keywords. */ \ michael@0: macro(class, class_, TOK_RESERVED, JSVERSION_DEFAULT) \ michael@0: macro(enum, enum_, TOK_RESERVED, JSVERSION_DEFAULT) \ michael@0: macro(extends, extends, TOK_RESERVED, JSVERSION_DEFAULT) \ michael@0: macro(super, super, TOK_RESERVED, JSVERSION_DEFAULT) \ michael@0: /* Future reserved keywords, but only in strict mode. */ \ michael@0: macro(implements, implements, TOK_STRICT_RESERVED, JSVERSION_DEFAULT) \ michael@0: macro(interface, interface, TOK_STRICT_RESERVED, JSVERSION_DEFAULT) \ michael@0: macro(package, package, TOK_STRICT_RESERVED, JSVERSION_DEFAULT) \ michael@0: macro(private, private_, TOK_STRICT_RESERVED, JSVERSION_DEFAULT) \ michael@0: macro(protected, protected_, TOK_STRICT_RESERVED, JSVERSION_DEFAULT) \ michael@0: macro(public, public_, TOK_STRICT_RESERVED, JSVERSION_DEFAULT) \ michael@0: macro(static, static_, TOK_STRICT_RESERVED, JSVERSION_DEFAULT) \ michael@0: /* \ michael@0: * Yield is a token inside function*. Outside of a function*, it is a \ michael@0: * future reserved keyword in strict mode, but a keyword in JS1.7 even \ michael@0: * when strict. Punt logic to parser. \ michael@0: */ \ michael@0: macro(yield, yield, TOK_YIELD, JSVERSION_DEFAULT) \ michael@0: /* \ michael@0: * Let is a future reserved keyword in strict mode, and a keyword in \ michael@0: * JS1.7. \ michael@0: */ \ michael@0: macro(let, let, TOK_LET, JSVERSION_1_7) michael@0: michael@0: #endif /* vm_Keywords_h */