[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/d-mode 0d45ab2 315/346: Fix brace stack logic creating unb
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/d-mode 0d45ab2 315/346: Fix brace stack logic creating unbalanced stacks |
Date: |
Sun, 29 Aug 2021 11:00:51 -0400 (EDT) |
branch: elpa/d-mode
commit 0d45ab266f92a672af478473681977727a99e7a7
Author: Vladimir Panteleev <git@thecybershadow.net>
Commit: Vladimir Panteleev <git@thecybershadow.net>
Fix brace stack logic creating unbalanced stacks
The old logic simply ignored the '{' when it occurred in a context
which carried over the toplevel-ness (static if), which caused the
matching '}' to be mis-parsed as belonging to a different '{'.
---
d-mode.el | 6 ++++--
tests/fonts.d | 6 ++++++
tests/fonts.d.html | 6 ++++++
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/d-mode.el b/d-mode.el
index 4d8f7aa..a6a084d 100644
--- a/d-mode.el
+++ b/d-mode.el
@@ -7,7 +7,7 @@
;; Maintainer: Russel Winder <russel@winder.org.uk>
;; Vladimir Panteleev <vladimir@thecybershadow.net>
;; Created: March 2007
-;; Version: 201911121047
+;; Version: 201911121107
;; Keywords: D programming language emacs cc-mode
;; Package-Requires: ((emacs "25.1"))
@@ -1190,7 +1190,9 @@ Currently handles `-delimited string literals."
;; context. I.e., the contents of a "static if"
at the
;; top level should remain top-level, but in a
function,
;; it should remain non-top-level.
- s
+ (if (<= (car s) 1)
+ (cons 1 s)
+ (cons (1+ (car s)) (cdr s)))
(cons (if (<= (car s) 0)
1
(1+ (car s)))
diff --git a/tests/fonts.d b/tests/fonts.d
index a32295d..666ab3e 100644
--- a/tests/fonts.d
+++ b/tests/fonts.d
@@ -59,3 +59,9 @@ void fun()
synchronized (a) {}
debug (a) {}
}
+
+void fun()
+{
+ if (a) {}
+ return gun();
+}
diff --git a/tests/fonts.d.html b/tests/fonts.d.html
index 9508e08..5dee5df 100644
--- a/tests/fonts.d.html
+++ b/tests/fonts.d.html
@@ -59,3 +59,9 @@ write(s ~ <span class="string">""</span>);
<span class="keyword">synchronized</span> (a) {}
<span class="keyword">debug</span> (<span class="constant">a</span>) {}
}
+
+<span class="type">void</span> <span class="function-name">fun</span>()
+{
+ <span class="keyword">if</span> (a) {}
+ <span class="keyword">return</span> gun();
+}
- [nongnu] elpa/d-mode 459732e 243/346: Fix parsing associative arrays in function types, (continued)
- [nongnu] elpa/d-mode 459732e 243/346: Fix parsing associative arrays in function types, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 362be11 250/346: Fix imenu false positive with e.g. private{...}, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode ea32e73 264/346: Makefile: Test byte-compiled version, too, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 979c946 256/346: Fix testing multiple nested imenu entries, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 8ffe5ac 265/346: Remove doxygen-font-lock-*, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 80f2019 261/346: Don't nest imenu to arbitrary depths, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode bdd5d78 281/346: Replace d-forward-decl-or-cast-1 implementation with a custom one, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 02d1c7f 290/346: tests: Add more binary operation tests, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 09ecdaa 303/346: Add "make coverage", ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 166fac8 313/346: Fix fontification of second foreach variable, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 0d45ab2 315/346: Fix brace stack logic creating unbalanced stacks,
ELPA Syncer <=
- [nongnu] elpa/d-mode 55c8cb0 306/346: Fontify types in function parameter lists, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode c22a8c1 309/346: Fontify variables in foreach loops, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 3731f1b 316/346: Fontify built-in @-keywords as keywords, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode e70d89f 312/346: Fix fontification of catch statements, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 2f7adb1 319/346: Fontify sole lambda params, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode b40a7ab 328/346: Unbundle undercover.el, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode a9c05fd 331/346: tests/I0102: Remove #min-version, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 32446a7 338/346: Merge pull request #107 from CyberShadow/github-actions, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode c3be102 344/346: Cask: Fetch undercover.el directly from git, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 7fdd7b2 343/346: .github/workflows/test.yml: Add final step to call the Coveralls webhook, ELPA Syncer, 2021/08/29