branch: elpa/raku-mode
commit 04988356e8e8b1ae67790d2718bc763b6aab27b3
Author: Hinrik Örn Sigurðsson <[email protected]>
Commit: Hinrik Örn Sigurðsson <[email protected]>

    Don't highlight type constraints inside strings/comments
---
 perl6-font-lock.el | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/perl6-font-lock.el b/perl6-font-lock.el
index 74cf7e0787..ab7cfbb8f5 100644
--- a/perl6-font-lock.el
+++ b/perl6-font-lock.el
@@ -354,8 +354,13 @@ LIMIT can be used to bound the search."
                       (opt (group (symbol type-property))))))
    (lambda ()
      (goto-char (match-beginning 0))
-     (not (looking-back (rx (or (char ".^")
-                                (and line-start (0+ space)))))))
+     (let* ((state (syntax-ppss))
+            (in-string (nth 3 state))
+            (in-comment (nth 4 state)))
+       (not (or in-string
+                in-comment
+                (looking-back (rx (or (char ".^")
+                                      (and line-start (0+ space)))))))))
    limit))
 
 (defun perl6-fontify (groups)

Reply via email to