@@ -47,13 +47,12 @@ const numericTypes = [
47
47
'f64' ,
48
48
] ;
49
49
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
+ '..' , '...' , '..=' , ',' , ';' , ':' , '::' , '->' , '=>' , '#' , '?' ,
57
56
] ;
58
57
59
58
const primitiveTypes = numericTypes . concat ( [ 'bool' , 'str' , 'char' ] ) ;
@@ -238,7 +237,7 @@ module.exports = grammar({
238
237
_non_special_token : $ => choice (
239
238
$ . _literal , $ . identifier , $ . mutable_specifier , $ . self , $ . super , $ . crate ,
240
239
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 ) ) ) ,
242
241
'\'' ,
243
242
'as' , 'async' , 'await' , 'break' , 'const' , 'continue' , 'default' , 'enum' , 'fn' , 'for' , 'if' , 'impl' ,
244
243
'let' , 'loop' , 'match' , 'mod' , 'pub' , 'return' , 'static' , 'struct' , 'trait' , 'type' ,
0 commit comments