@@ -239,9 +239,9 @@ module.exports = grammar({
239239 alias ( choice ( ...primitiveTypes ) , $ . primitive_type ) ,
240240 prec . right ( repeat1 ( choice ( ...TOKEN_TREE_NON_SPECIAL_PUNCTUATION ) ) ) ,
241241 '\'' ,
242- 'as' , 'async' , 'await' , 'break' , 'const' , 'continue' , 'default' , 'enum' , 'fn' , 'for' , 'if' , 'impl ',
243- 'let' , 'loop' , 'match' , 'mod' , 'pub' , 'return' , 'static' , 'struct' , 'trait' , 'type ',
244- 'union' , 'unsafe' , 'use' , 'where' , 'while' ,
242+ 'as' , 'async' , 'await' , 'break' , 'const' , 'continue' , 'default' , 'enum' , 'fn' , 'for' , 'gen ' ,
243+ 'if' , 'impl' , ' let', 'loop' , 'match' , 'mod' , 'pub' , 'return' , 'static' , 'struct' , 'trait' ,
244+ 'type' , ' union', 'unsafe' , 'use' , 'where' , 'while' ,
245245 ) ,
246246
247247 // Section - Declarations
@@ -931,6 +931,7 @@ module.exports = grammar({
931931 _expression_ending_with_block : $ => choice (
932932 $ . unsafe_block ,
933933 $ . async_block ,
934+ $ . gen_block ,
934935 $ . try_block ,
935936 $ . block ,
936937 $ . if_expression ,
@@ -1311,6 +1312,12 @@ module.exports = grammar({
13111312 $ . block ,
13121313 ) ,
13131314
1315+ gen_block : $ => seq (
1316+ 'gen' ,
1317+ optional ( 'move' ) ,
1318+ $ . block ,
1319+ ) ,
1320+
13141321 try_block : $ => seq (
13151322 'try' ,
13161323 $ . block ,
0 commit comments