@@ -37,11 +37,13 @@ class Keyword(Token):
37
37
"""
38
38
39
39
def __init__ (self , name , text , serialization_code ,
40
- classification = 'Keyword' ):
40
+ classification = 'Keyword' ,
41
+ requires_leading_space = False , requires_trailing_space = True ):
41
42
Token .__init__ (self , name , 'kw_' + text , serialization_code ,
42
43
unprefixed_kind = text , text = text ,
43
44
classification = classification , is_keyword = True ,
44
- requires_trailing_space = True )
45
+ requires_leading_space = requires_leading_space ,
46
+ requires_trailing_space = requires_trailing_space )
45
47
46
48
def macro_name (self ):
47
49
return "KEYWORD"
@@ -171,7 +173,8 @@ def macro_name(self):
171
173
StmtKeyword ('Defer' , 'defer' , serialization_code = 23 ),
172
174
StmtKeyword ('If' , 'if' , serialization_code = 24 ),
173
175
StmtKeyword ('Guard' , 'guard' , serialization_code = 25 ),
174
- StmtKeyword ('Do' , 'do' , serialization_code = 26 ),
176
+ StmtKeyword ('Do' , 'do' , requires_trailing_space = False ,
177
+ serialization_code = 26 ),
175
178
StmtKeyword ('Repeat' , 'repeat' , serialization_code = 27 ),
176
179
StmtKeyword ('Else' , 'else' , serialization_code = 28 ),
177
180
StmtKeyword ('For' , 'for' , serialization_code = 29 ),
@@ -184,8 +187,10 @@ def macro_name(self):
184
187
StmtKeyword ('Switch' , 'switch' , serialization_code = 36 ),
185
188
StmtKeyword ('Case' , 'case' , serialization_code = 37 ),
186
189
StmtKeyword ('Default' , 'default' , serialization_code = 38 ),
187
- StmtKeyword ('Where' , 'where' , serialization_code = 39 ),
188
- StmtKeyword ('Catch' , 'catch' , serialization_code = 40 ),
190
+ StmtKeyword ('Where' , 'where' , requires_leading_space = True ,
191
+ serialization_code = 39 ),
192
+ StmtKeyword ('Catch' , 'catch' , requires_leading_space = True ,
193
+ requires_trailing_space = False , serialization_code = 40 ),
189
194
StmtKeyword ('Throw' , 'throw' , serialization_code = 50 ),
190
195
191
196
# Expression keywords
0 commit comments