[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/raku-mode 3cf99d162f 088/253: Treat backslashes outside st
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/raku-mode 3cf99d162f 088/253: Treat backslashes outside strings as punctuation |
Date: |
Sat, 29 Jan 2022 08:28:45 -0500 (EST) |
branch: elpa/raku-mode
commit 3cf99d162f054f6a7cc3515e42a7792175bba402
Author: Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
Commit: Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
Treat backslashes outside strings as punctuation
This makes SMIE not choke on backslashes when indenting.
---
perl6-font-lock.el | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/perl6-font-lock.el b/perl6-font-lock.el
index 441786b472..1b79c44244 100644
--- a/perl6-font-lock.el
+++ b/perl6-font-lock.el
@@ -343,6 +343,14 @@ OPEN-ANGLES is the opening delimiter (e.g. \"«\" or
\"<<\")."
(put-text-property quote-end (1+ quote-end)
'syntax-table (string-to-syntax "|"))))))))
+(defun perl6-syntax-propertize-backslash ()
+ (let* ((state (syntax-ppss))
+ (in-string (nth 3 state))
+ (in-comment (nth 4 state)))
+ (unless (or in-string in-comment)
+ (put-text-property (match-beginning 0) (match-end 0)
+ 'syntax-table (string-to-syntax ".")))))
+
(defun perl6-add-font-lock-hint (property &optional group)
(let ((beg (match-beginning (or group 1)))
context)
@@ -370,7 +378,9 @@ Takes arguments START and END which delimit the region to
propertize."
((perl6-rx (or set-operator rsxz-operator))
(0 (ignore (perl6-add-font-lock-hint 'perl6-metaoperator 0))))
((rx (1+ (char "<«")))
- (0 (ignore (perl6-syntax-propertize-angles (match-string 0))))))
+ (0 (ignore (perl6-syntax-propertize-angles (match-string 0)))))
+ ((rx "\\")
+ (0 (ignore (perl6-syntax-propertize-backslash)))))
start end)))
(defun perl6-font-lock-syntactic-face (state)
- [nongnu] elpa/raku-mode b111c81c75 031/253: Move set operator regex into perl6-rx, (continued)
- [nongnu] elpa/raku-mode b111c81c75 031/253: Move set operator regex into perl6-rx, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 1ef289eb4d 012/253: Consider 4096 be eof when looking for the next line, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 2257deb15a 013/253: Simplify the magic matching logic, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode a94d11b812 017/253: Complete support for embedded/multiline comments, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 29b821fc44 075/253: Rename function to be more descriptive, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 0673f007b0 056/253: SMIE indenation ported from css-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 1ff189c6e7 060/253: TIL about `point-at-bol', ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 3e55db2507 069/253: Avoid highlighting X::Foo as a metaoperator, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode ae9843c53e 121/253: Actually save the syntax context with the font lock hint, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 8643c07c42 108/253: Improve highlighting of postfix hyper operators, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 3cf99d162f 088/253: Treat backslashes outside strings as punctuation,
ELPA Syncer <=
- [nongnu] elpa/raku-mode 81c13d03ea 174/253: Be even more verbose, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 8e7d64a73f 025/253: Apply 'syntax-multiline to the whole term, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 3b781c2ded 042/253: Highlight version literals, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode bb7219afc4 043/253: Highlight autoquoted strings, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 98e3cbfabf 053/253: Always use a limit with `looking-back', ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 024ef71927 064/253: Highlight type constraints, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 9ca9a0caa7 082/253: Highlight identifiers containing underscore, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode c93daf2353 096/253: Avoid highlighting X::Foo and X:: as cross-metaoperators, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 94ba374818 117/253: Realign code, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode e4a86350be 111/253: Fix tests in light of recent changes, ELPA Syncer, 2022/01/29