From f269c5ed312715fe862a32fae79f3e12131b1b7a Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 21 Mar 2017 21:36:05 -0600 Subject: fix syntax of "<" appearing after "?" The "<" syntax-setting code could be confused after a "?". This patch changes the code to treat "?" as an "ambiguous operator" and adjust according to further context. Fixes #200 --- rust-mode.el | 3 +++ 1 file changed, 3 insertions(+) (limited to 'rust-mode.el') diff --git a/rust-mode.el b/rust-mode.el index 4fadd81..00714a9 100644 --- a/rust-mode.el +++ b/rust-mode.el @@ -1012,6 +1012,9 @@ the desired identifiers), but does not match type annotations \"foo::<\"." ((rust-looking-back-symbols rust-mode-keywords) (rust-looking-back-symbols '("self" "true" "false"))) + ((rust-looking-back-str "?") + (rust-is-in-expression-context 'ambiguous-operator)) + ;; If we're looking back at an identifier, this depends on whether ;; the identifier is part of an expression or a type ((rust-looking-back-ident) -- cgit v1.2.3