From e093da4af7259f960c613df6d9c6b6fe3ccc0c9b Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Tue, 8 Nov 2022 14:29:19 +0200 Subject: [PATCH] FIXED: only consider backslash as an escape inside strings --- sweeprolog.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sweeprolog.el b/sweeprolog.el index 060c8ea..a4dd6dd 100644 --- a/sweeprolog.el +++ b/sweeprolog.el @@ -80,6 +80,7 @@ Prolog token as returned from `sweeprolog-last-token-boundaries'.") (modify-syntax-entry ?~ "." table) (modify-syntax-entry ?_ "_" table) (modify-syntax-entry ?| "." table) + (modify-syntax-entry ?\\ "\\" table) (modify-syntax-entry ?\' "\"" table) (modify-syntax-entry ?` "\"" table) (modify-syntax-entry ?% "<" table) @@ -1993,10 +1994,13 @@ modified." (let ((case-fold-search nil)) (funcall (syntax-propertize-rules + ((rx (group-n 1 "\\") anychar) + (1 (unless (save-excursion (nth 8 (syntax-ppss (match-beginning 0)))) + (string-to-syntax ".")))) ((rx bow (group-n 1 "0'" anychar)) (1 (unless (save-excursion (nth 8 (syntax-ppss (match-beginning 0)))) (string-to-syntax "w")))) - ((rx bow (group-n 1 "!") eow) + ((rx bow (group-n 1 "!")) (1 (unless (save-excursion (nth 8 (syntax-ppss (match-beginning 0)))) (string-to-syntax "w"))))) start end))) -- 2.39.2