| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_TOKEN_H_ | 5 #ifndef VM_TOKEN_H_ |
| 6 #define VM_TOKEN_H_ | 6 #define VM_TOKEN_H_ |
| 7 | 7 |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 TOK(kINTERPOL_END, "}", 0, kNoAttribute) \ | 127 TOK(kINTERPOL_END, "}", 0, kNoAttribute) \ |
| 128 \ | 128 \ |
| 129 TOK(kAT, "@", 0, kNoAttribute) \ | 129 TOK(kAT, "@", 0, kNoAttribute) \ |
| 130 \ | 130 \ |
| 131 TOK(kWHITESP, "", 0, kNoAttribute) \ | 131 TOK(kWHITESP, "", 0, kNoAttribute) \ |
| 132 TOK(kERROR, "", 0, kNoAttribute) \ | 132 TOK(kERROR, "", 0, kNoAttribute) \ |
| 133 TOK(kILLEGAL, "", 0, kNoAttribute) \ | 133 TOK(kILLEGAL, "", 0, kNoAttribute) \ |
| 134 \ | 134 \ |
| 135 /* Support for Dart scripts. */ \ | 135 /* Support for Dart scripts. */ \ |
| 136 TOK(kSCRIPTTAG, "#!", 0, kNoAttribute) \ | 136 TOK(kSCRIPTTAG, "#!", 0, kNoAttribute) \ |
| 137 TOK(kLIBRARY, "#library", 0, kNoAttribute) \ | 137 TOK(kLEGACY_LIBRARY, "#library", 0, kNoAttribute) \ |
| 138 TOK(kIMPORT, "#import", 0, kNoAttribute) \ | 138 TOK(kLEGACY_IMPORT, "#import", 0, kNoAttribute) \ |
| 139 TOK(kSOURCE, "#source", 0, kNoAttribute) \ | 139 TOK(kLEGACY_SOURCE, "#source", 0, kNoAttribute) \ |
| 140 | 140 |
| 141 // List of keywords. The list must be alphabetically ordered. The | 141 // List of keywords. The list must be alphabetically ordered. The |
| 142 // keyword recognition code depends on the ordering. | 142 // keyword recognition code depends on the ordering. |
| 143 // If you add a keyword at the beginning or end of this list, make sure | 143 // If you add a keyword at the beginning or end of this list, make sure |
| 144 // to update kFirstKeyword and kLastKeyword below. | 144 // to update kFirstKeyword and kLastKeyword below. |
| 145 #define DART_KEYWORD_LIST(KW) \ | 145 #define DART_KEYWORD_LIST(KW) \ |
| 146 KW(kABSTRACT, "abstract", 0, kPseudoKeyword) /* == kFirstKeyword */ \ | 146 KW(kABSTRACT, "abstract", 0, kPseudoKeyword) /* == kFirstKeyword */ \ |
| 147 KW(kASSERT, "assert", 0, kKeyword) \ | 147 KW(kASSERT, "assert", 0, kKeyword) \ |
| 148 KW(kBREAK, "break", 0, kKeyword) \ | 148 KW(kBREAK, "break", 0, kKeyword) \ |
| 149 KW(kCASE, "case", 0, kKeyword) \ | 149 KW(kCASE, "case", 0, kKeyword) \ |
| 150 KW(kCATCH, "catch", 0, kKeyword) \ | 150 KW(kCATCH, "catch", 0, kKeyword) \ |
| 151 KW(kCLASS, "class", 0, kKeyword) \ | 151 KW(kCLASS, "class", 0, kKeyword) \ |
| 152 KW(kCONST, "const", 0, kKeyword) \ | 152 KW(kCONST, "const", 0, kKeyword) \ |
| 153 KW(kCONTINUE, "continue", 0, kKeyword) \ | 153 KW(kCONTINUE, "continue", 0, kKeyword) \ |
| 154 KW(kDEFAULT, "default", 0, kKeyword) \ | 154 KW(kDEFAULT, "default", 0, kKeyword) \ |
| 155 KW(kDO, "do", 0, kKeyword) \ | 155 KW(kDO, "do", 0, kKeyword) \ |
| 156 KW(kELSE, "else", 0, kKeyword) \ | 156 KW(kELSE, "else", 0, kKeyword) \ |
| 157 KW(kEXPORT, "export", 0, kPseudoKeyword) \ |
| 157 KW(kEXTENDS, "extends", 0, kKeyword) \ | 158 KW(kEXTENDS, "extends", 0, kKeyword) \ |
| 158 KW(kEXTERNAL, "external", 0, kPseudoKeyword) \ | 159 KW(kEXTERNAL, "external", 0, kPseudoKeyword) \ |
| 159 KW(kFACTORY, "factory", 0, kPseudoKeyword) \ | 160 KW(kFACTORY, "factory", 0, kPseudoKeyword) \ |
| 160 KW(kFALSE, "false", 0, kKeyword) \ | 161 KW(kFALSE, "false", 0, kKeyword) \ |
| 161 KW(kFINAL, "final", 0, kKeyword) \ | 162 KW(kFINAL, "final", 0, kKeyword) \ |
| 162 KW(kFINALLY, "finally", 0, kKeyword) \ | 163 KW(kFINALLY, "finally", 0, kKeyword) \ |
| 163 KW(kFOR, "for", 0, kKeyword) \ | 164 KW(kFOR, "for", 0, kKeyword) \ |
| 164 KW(kGET, "get", 0, kPseudoKeyword) \ | 165 KW(kGET, "get", 0, kPseudoKeyword) \ |
| 165 KW(kIF, "if", 0, kKeyword) \ | 166 KW(kIF, "if", 0, kKeyword) \ |
| 166 KW(kIMPLEMENTS, "implements", 0, kPseudoKeyword) \ | 167 KW(kIMPLEMENTS, "implements", 0, kPseudoKeyword) \ |
| 168 KW(kIMPORT, "import", 0, kPseudoKeyword) \ |
| 167 KW(kIN, "in", 0, kKeyword) \ | 169 KW(kIN, "in", 0, kKeyword) \ |
| 168 KW(kINTERFACE, "interface", 0, kPseudoKeyword) \ | 170 KW(kINTERFACE, "interface", 0, kPseudoKeyword) \ |
| 169 KW(kIS, "is", 10, kKeyword) \ | 171 KW(kIS, "is", 10, kKeyword) \ |
| 172 KW(kLIBRARY, "library", 0, kPseudoKeyword) \ |
| 170 KW(kNEW, "new", 0, kKeyword) \ | 173 KW(kNEW, "new", 0, kKeyword) \ |
| 171 KW(kNULL, "null", 0, kKeyword) \ | 174 KW(kNULL, "null", 0, kKeyword) \ |
| 172 KW(kOPERATOR, "operator", 0, kPseudoKeyword) \ | 175 KW(kOPERATOR, "operator", 0, kPseudoKeyword) \ |
| 176 KW(kPART, "part", 0, kPseudoKeyword) \ |
| 173 KW(kRETURN, "return", 0, kKeyword) \ | 177 KW(kRETURN, "return", 0, kKeyword) \ |
| 174 KW(kSET, "set", 0, kPseudoKeyword) \ | 178 KW(kSET, "set", 0, kPseudoKeyword) \ |
| 175 KW(kSTATIC, "static", 0, kPseudoKeyword) \ | 179 KW(kSTATIC, "static", 0, kPseudoKeyword) \ |
| 176 KW(kSUPER, "super", 0, kKeyword) \ | 180 KW(kSUPER, "super", 0, kKeyword) \ |
| 177 KW(kSWITCH, "switch", 0, kKeyword) \ | 181 KW(kSWITCH, "switch", 0, kKeyword) \ |
| 178 KW(kTHIS, "this", 0, kKeyword) \ | 182 KW(kTHIS, "this", 0, kKeyword) \ |
| 179 KW(kTHROW, "throw", 0, kKeyword) \ | 183 KW(kTHROW, "throw", 0, kKeyword) \ |
| 180 KW(kTRUE, "true", 0, kKeyword) \ | 184 KW(kTRUE, "true", 0, kKeyword) \ |
| 181 KW(kTRY, "try", 0, kKeyword) \ | 185 KW(kTRY, "try", 0, kKeyword) \ |
| 182 KW(kTYPEDEF, "typedef", 0, kPseudoKeyword) \ | 186 KW(kTYPEDEF, "typedef", 0, kPseudoKeyword) \ |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 static const char* name_[]; | 297 static const char* name_[]; |
| 294 static const char* tok_str_[]; | 298 static const char* tok_str_[]; |
| 295 static const uint8_t precedence_[]; | 299 static const uint8_t precedence_[]; |
| 296 static const Attribute attributes_[]; | 300 static const Attribute attributes_[]; |
| 297 }; | 301 }; |
| 298 | 302 |
| 299 | 303 |
| 300 } // namespace dart | 304 } // namespace dart |
| 301 | 305 |
| 302 #endif // VM_TOKEN_H_ | 306 #endif // VM_TOKEN_H_ |
| OLD | NEW |