[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/raku-mode 75e4c4831d 022/253: Clean up the code for commen
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/raku-mode 75e4c4831d 022/253: Clean up the code for comment detection a bit |
Date: |
Sat, 29 Jan 2022 08:28:35 -0500 (EST) |
branch: elpa/raku-mode
commit 75e4c4831d6e13f8299784e450c632d5b38669b4
Author: Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
Commit: Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
Clean up the code for comment detection a bit
---
perl6-font-lock.el | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/perl6-font-lock.el b/perl6-font-lock.el
index 3383e77b04..d679fe7329 100644
--- a/perl6-font-lock.el
+++ b/perl6-font-lock.el
@@ -184,13 +184,13 @@
table)
"Syntax table for comments.")
-(defun perl6-forward-embedded-comment (open close length)
- "Move point past the end of an embedded comment.
+(defun perl6-forward-brackets (open close length)
+ "Move point past the end of a bracketed structure.
-Skips over any nested balanced delimiters.
+Skips over any nested balanced brackets.
-OPEN and CLOSE are the delimiting characters (e.g. ?< and ?>).
-LENGTH is the length of the delimiters (e.g. 2 for a #`<<foo>> comment)."
+OPEN and CLOSE are the bracketing characters (e.g. ?< and ?>).
+LENGTH is the length of the brackets (e.g. 2 for a <<foo>>)."
(let ((pattern (rx-to-string `(or (group (= ,length ,open))
(group (= ,length ,close)))))
(found-closing nil)
@@ -208,7 +208,7 @@ LENGTH is the length of the delimiters (e.g. 2 for a
#`<<foo>> comment)."
(setq found-closing t)))))))
(defun perl6-syntax-propertize-embedded-comment ()
- "Add syntax properties to embedded comments."
+ "Add syntax properties to embedded comments \(#`<<foo>>\)."
(with-syntax-table perl6-comment-syntax-table
(when (and (following-char)
(eq ?\( (char-syntax (following-char))))
@@ -219,10 +219,11 @@ LENGTH is the length of the delimiters (e.g. 2 for a
#`<<foo>> comment)."
'syntax-table (string-to-syntax "!"))
(re-search-forward (rx-to-string `(1+ ,open-delim)))
(let ((delim-length (length (match-string 0))))
- (perl6-forward-embedded-comment open-delim close-delim delim-length)
- (put-text-property comment-beg (point) 'syntax-multiline t)
- (put-text-property (- (point) 1) (point)
- 'syntax-table (string-to-syntax "!")))))))
+ (perl6-forward-brackets open-delim close-delim delim-length)
+ (let ((comment-end (point)))
+ (put-text-property comment-beg comment-end 'syntax-multiline t)
+ (put-text-property (- comment-end 1) comment-end
+ 'syntax-table (string-to-syntax "!"))))))))
(defun perl6-syntax-propertize (start end)
"Add context-specific syntax properties to code.
- [nongnu] elpa/raku-mode 759b21553f 189/253: Fix keybinds and menu, (continued)
- [nongnu] elpa/raku-mode 759b21553f 189/253: Fix keybinds and menu, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 588dc4417b 166/253: add new files, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 26fc7115b5 215/253: Add information about the auto-insert skeletons to the README., ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 44529c097f 221/253: Merge pull request #32 from widefox/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode ac967de8a4 222/253: Fix #33: missed interpreter & mode autoloads, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 02bf289149 242/253: Merge pull request #45 from sumanstats/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 0fc63c3ce1 001/253: Initial import, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 623b5b559a 018/253: Syntaxify double colons around identifiers as symbol chars, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 142ff3e928 030/253: Highlight variable package differently from variable name, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 127b125ab1 034/253: Use a smaller heading, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 75e4c4831d 022/253: Clean up the code for comment detection a bit,
ELPA Syncer <=
- [nongnu] elpa/raku-mode 0d3485a324 027/253: Better highlighting angled quotes, and set operators, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 7078ed08b4 033/253: font-lock-exit-face is not standard, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode f9bf3f7689 037/253: Improve code layout a bit, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 6a4269e30b 005/253: Make sure the magic autoloads correctly, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 0be377dba8 040/253: Place manual installation instructions last, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 8f9d68dc38 047/253: Add note about find-file-at-point, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 6cb23a3a64 058/253: Move indentation support into perl6-indent.el, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 4917b2c270 055/253: Highlight #=() and #|() comments, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 284a341125 046/253: Set comment-start-skip, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode eaf48dd813 049/253: Add Travis integration, ELPA Syncer, 2022/01/29