@@ -47,13 +47,12 @@ const numericTypes = [
4747 'f64' ,
4848] ;
4949
50- const TOKEN_TREE_NON_SPECIAL_TOKENS = [
51- '/' , '_' , '\\' , '-' ,
52- '=' , '->' , ',' , ';' ,
53- ':' , '::' , '!' , '?' ,
54- '.' , '@' , '*' , '&' ,
55- '#' , '%' , '^' , '+' ,
56- '<' , '>' , '|' , '~' ,
50+ // https://doc.rust-lang.org/reference/tokens.html#punctuation
51+ const TOKEN_TREE_NON_SPECIAL_PUNCTUATION = [
52+ '+' , '-' , '*' , '/' , '%' , '^' , '!' , '&' , '|' , '&&' , '||' , '<<' ,
53+ '>>' , '+=' , '-=' , '*=' , '/=' , '%=' , '^=' , '&=' , '|=' , '<<=' ,
54+ '>>=' , '=' , '==' , '!=' , '>' , '<' , '>=' , '<=' , '@' , '_' , '.' ,
55+ '..' , '...' , '..=' , ',' , ';' , ':' , '::' , '->' , '=>' , '#' , '?' ,
5756] ;
5857
5958const primitiveTypes = numericTypes . concat ( [ 'bool' , 'str' , 'char' ] ) ;
@@ -238,7 +237,7 @@ module.exports = grammar({
238237 _non_special_token : $ => choice (
239238 $ . _literal , $ . identifier , $ . mutable_specifier , $ . self , $ . super , $ . crate ,
240239 alias ( choice ( ...primitiveTypes ) , $ . primitive_type ) ,
241- prec . right ( repeat1 ( choice ( ...TOKEN_TREE_NON_SPECIAL_TOKENS ) ) ) ,
240+ prec . right ( repeat1 ( choice ( ...TOKEN_TREE_NON_SPECIAL_PUNCTUATION ) ) ) ,
242241 '\'' ,
243242 'as' , 'async' , 'await' , 'break' , 'const' , 'continue' , 'default' , 'enum' , 'fn' , 'for' , 'if' , 'impl' ,
244243 'let' , 'loop' , 'match' , 'mod' , 'pub' , 'return' , 'static' , 'struct' , 'trait' , 'type' ,
0 commit comments