[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/nix-mode 87ba3a26c1 05/14: Fix $$ in string literals
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/nix-mode 87ba3a26c1 05/14: Fix $$ in string literals |
Date: |
Tue, 19 Jul 2022 01:58:49 -0400 (EDT) |
branch: elpa/nix-mode
commit 87ba3a26c15e105d98845d29cab7900791cb5d45
Author: Nicholas Coltharp <coltharp@pdx.edu>
Commit: Nicholas Coltharp <coltharp@pdx.edu>
Fix $$ in string literals
- Inside a string literal, one "$" always removes any special meaning
from any following "$"; i.e., the string "$${x}" has no antiquote. Add
a rule that ignores $$.
- This breaks an edge case: in a double-quoted string, the character
sequence "\$${" should be treated as a literal "$" followed by an
antiquote open. Add a special rule for this case.
---
nix-mode.el | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/nix-mode.el b/nix-mode.el
index 8d00fa2f99..9c8cb46842 100644
--- a/nix-mode.el
+++ b/nix-mode.el
@@ -252,6 +252,14 @@ STRING-TYPE type of string based off of Emacs syntax table
types"
(t
(nix--mark-string (1- end) ?\'))))))))
+(defun nix--antiquote-sq-style ()
+ "Hande Nix antiquote sq style."
+ (let* ((start (match-beginning 0))
+ (ps (nix--get-parse-state start))
+ (string-type (nix--get-string-type ps)))
+ (when (equal string-type ?\")
+ (nix--antiquote-open-at (+ start 2) ?\"))))
+
(defun nix--escaped-antiquote-dq-style ()
"Handle Nix escaped antiquote dq style."
(let* ((start (match-beginning 0))
@@ -348,6 +356,10 @@ STRING-TYPE type of string based off of Emacs syntax table
types"
(0 nil))
("\\\\\""
(0 nil))
+ ("\\$\\$"
+ (0 nil))
+ ("\\\\\\$\\${"
+ (0 (ignore (nix--\$${))))
("\\\\\\${"
(0 (ignore (nix--escaped-antiquote-dq-style))))
("'\\{2,\\}"
- [nongnu] elpa/nix-mode updated (8fe2ccf0b0 -> b3f71c75f7), ELPA Syncer, 2022/07/19
- [nongnu] elpa/nix-mode 80b05d3df7 08/14: Fix docstring for new function, ELPA Syncer, 2022/07/19
- [nongnu] elpa/nix-mode 7072348b55 03/14: Fix syntax highlighting for ''$ in indented strings, ELPA Syncer, 2022/07/19
- [nongnu] elpa/nix-mode acf6f9d573 06/14: Code style: change (+ 1 ...) to (1+ ...), ELPA Syncer, 2022/07/19
- [nongnu] elpa/nix-mode acf4d6fdce 07/14: Naming change, ELPA Syncer, 2022/07/19
- [nongnu] elpa/nix-mode 7fbde25122 09/14: Add tests for issue 157, ELPA Syncer, 2022/07/19
- [nongnu] elpa/nix-mode bac87932a8 02/14: chore(deps): bump cachix/install-nix-action from 16 to 17, ELPA Syncer, 2022/07/19
- [nongnu] elpa/nix-mode bca3d518e3 01/14: chore(deps): bump actions/checkout from 2 to 3, ELPA Syncer, 2022/07/19
- [nongnu] elpa/nix-mode 0950294c48 04/14: Fix out-of-bounds error, ELPA Syncer, 2022/07/19
- [nongnu] elpa/nix-mode 5669eff2ad 13/14: Merge pull request #151 from NixOS/dependabot/github_actions/actions/checkout-3, ELPA Syncer, 2022/07/19
- [nongnu] elpa/nix-mode 87ba3a26c1 05/14: Fix $$ in string literals,
ELPA Syncer <=
- [nongnu] elpa/nix-mode 8bd12b16b8 10/14: fix wrong enum value in nix-has-flakes, ELPA Syncer, 2022/07/19
- [nongnu] elpa/nix-mode 5d5704d846 11/14: Merge pull request #159 from aameen-tulip/master, ELPA Syncer, 2022/07/19
- [nongnu] elpa/nix-mode e22819a73b 12/14: Merge pull request #157 from nosewings/master, ELPA Syncer, 2022/07/19
- [nongnu] elpa/nix-mode b3f71c75f7 14/14: Merge pull request #153 from NixOS/dependabot/github_actions/cachix/install-nix-action-17, ELPA Syncer, 2022/07/19