File tree Expand file tree Collapse file tree 1 file changed +57
-17
lines changed Expand file tree Collapse file tree 1 file changed +57
-17
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,26 @@ const (
98
98
RETURN
99
99
WHILE
100
100
101
+ // Reserved words (following Python); unused in Starlark
102
+
103
+ AS
104
+ // ASSERT // heavily used in our tests
105
+ ASYNC
106
+ AWAIT
107
+ CLASS
108
+ DEL
109
+ EXCEPT
110
+ FINALLY
111
+ FROM
112
+ GLOBAL
113
+ IMPORT
114
+ IS
115
+ NONLOCAL
116
+ RAISE
117
+ TRY
118
+ WITH
119
+ YIELD
120
+
101
121
maxToken
102
122
)
103
123
@@ -180,6 +200,26 @@ var tokenNames = [...]string{
180
200
PASS : "pass" ,
181
201
RETURN : "return" ,
182
202
WHILE : "while" ,
203
+
204
+ // Reserved words (following Python); unused in Starlark
205
+
206
+ AS : "as" ,
207
+ // ASSERT: "assert", // heavily used in our tests
208
+ ASYNC : "async" ,
209
+ AWAIT : "await" ,
210
+ CLASS : "class" ,
211
+ DEL : "del" ,
212
+ EXCEPT : "except" ,
213
+ FINALLY : "finally" ,
214
+ FROM : "from" ,
215
+ GLOBAL : "global" ,
216
+ IMPORT : "import" ,
217
+ IS : "is" ,
218
+ NONLOCAL : "nonlocal" ,
219
+ RAISE : "raise" ,
220
+ TRY : "try" ,
221
+ WITH : "with" ,
222
+ YIELD : "yield" ,
183
223
}
184
224
185
225
// A FilePortion describes the content of a portion of a file.
@@ -1104,21 +1144,21 @@ var keywordToken = map[string]Token{
1104
1144
"while" : WHILE ,
1105
1145
1106
1146
// reserved words:
1107
- "as" : ILLEGAL ,
1108
- // "assert": ILLEGAL , // heavily used by our tests
1109
- "async" : ILLEGAL ,
1110
- "await" : ILLEGAL ,
1111
- "class" : ILLEGAL ,
1112
- "del" : ILLEGAL ,
1113
- "except" : ILLEGAL ,
1114
- "finally" : ILLEGAL ,
1115
- "from" : ILLEGAL ,
1116
- "global" : ILLEGAL ,
1117
- "import" : ILLEGAL ,
1118
- "is" : ILLEGAL ,
1119
- "nonlocal" : ILLEGAL ,
1120
- "raise" : ILLEGAL ,
1121
- "try" : ILLEGAL ,
1122
- "with" : ILLEGAL ,
1123
- "yield" : ILLEGAL ,
1147
+ "as" : AS ,
1148
+ // "assert": ASSERT , // heavily used by our tests
1149
+ "async" : ASYNC ,
1150
+ "await" : AWAIT ,
1151
+ "class" : CLASS ,
1152
+ "del" : DEL ,
1153
+ "except" : EXCEPT ,
1154
+ "finally" : FINALLY ,
1155
+ "from" : FROM ,
1156
+ "global" : GLOBAL ,
1157
+ "import" : IMPORT ,
1158
+ "is" : IS ,
1159
+ "nonlocal" : NONLOCAL ,
1160
+ "raise" : RAISE ,
1161
+ "try" : TRY ,
1162
+ "with" : WITH ,
1163
+ "yield" : YIELD ,
1124
1164
}
You can’t perform that action at this time.
0 commit comments