Ensure :: is treated as a single token in Rust

pull/25/head
Wilfred Hughes 2021-07-07 22:02:20 +07:00
parent da8a4c1ee1
commit c43e724caf
2 changed files with 5 additions and 3 deletions

@ -3,9 +3,9 @@
Diffs are now displayed with unchanged lines aligned to the other side.
Improved Rust parsing to recognise lifetime syntax `'foo`, character
literals `'x'` and sequences of punctuation.
literals `'x'` and punctuation.
Improve punctuation parsing for OCaml and JS.
Improved punctuation parsing for OCaml and JS.
Fixed an issue where the diff calculated may not be minimal.

@ -156,7 +156,9 @@ atom_patterns = [
"'[a-z_]+",
# Symbols (e.g. variable names)
'[a-zA-Z0-9_]+!?',
# Operators
# Two character operators
'(::|&&|\|\|)',
# Single character operators
# | is a delimiter for lambdas, but also used in pattern matching.
'[.&=<>/*+:;,|#!?-]',
]