From c43e724caf7430b0adc9e6925afea0cbf66e50f4 Mon Sep 17 00:00:00 2001 From: Wilfred Hughes Date: Wed, 7 Jul 2021 22:02:20 -0700 Subject: [PATCH] Ensure :: is treated as a single token in Rust --- CHANGELOG.md | 4 ++-- config/syntax.toml | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ebc68b09a..8141c8fa0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/config/syntax.toml b/config/syntax.toml index 61037eb56..3052d89c4 100644 --- a/config/syntax.toml +++ b/config/syntax.toml @@ -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. '[.&=<>/*+:;,|#!?-]', ]