summaryrefslogtreecommitdiff
path: root/rust-mode-tests.el
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2017-03-21 21:36:05 -0600
committerTom Tromey <tom@tromey.com>2017-04-05 09:26:39 -0600
commitf269c5ed312715fe862a32fae79f3e12131b1b7a (patch)
tree8865b20ed91d02ffe3b24f97d62f2809acafdab1 /rust-mode-tests.el
parent19e6f604a0c9d838a1426604d70ce3af0960621d (diff)
downloadrust-mode-f269c5ed312715fe862a32fae79f3e12131b1b7a.tar.gz
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
Diffstat (limited to 'rust-mode-tests.el')
-rw-r--r--rust-mode-tests.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index f7c2a91..dc561e1 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -1891,6 +1891,13 @@ fn main() {
"))
(test-indent text text)))
+(ert-deftest indent-question-mark-operator ()
+ (test-indent "fn foo() {
+ if bar()? < 1 {
+ }
+ baz();
+}"))
+
(defun rust-test-matching-parens (content pairs &optional nonparen-positions)
"Assert that in rust-mode, given a buffer with the given `content',
emacs's paren matching will find all of the pairs of positions