emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/haskell-tng-mode 3d1122b 116/385: notes on regexps


From: ELPA Syncer
Subject: [nongnu] elpa/haskell-tng-mode 3d1122b 116/385: notes on regexps
Date: Tue, 5 Oct 2021 23:59:13 -0400 (EDT)

branch: elpa/haskell-tng-mode
commit 3d1122bb30c7aa9688edde8d6bf2311e234aaf49
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>

    notes on regexps
---
 haskell-tng-smie.el   | 7 +++++--
 haskell-tng-syntax.el | 4 ++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/haskell-tng-smie.el b/haskell-tng-smie.el
index 5fd149e..0e381aa 100644
--- a/haskell-tng-smie.el
+++ b/haskell-tng-smie.el
@@ -194,8 +194,11 @@ current line."
 ;; 2. exposing the parse tree so that s-expression navigation could be
 ;;    implemented and tests could be easier to write.
 ;;
-;; 3. if the Emacs regexps allowed arbitrary zero length matches, especially if
-;;    syntax "categories" were allowed.
+;; 3. if the Emacs regexps allowed arbitrary zero-width matches, especially if
+;;    syntax "categories" were allowed. i.e. in the Java regexp engine these 
are
+;;    (?=X) (?!X) (?<=X) (?<!X) where X can be an Emacs syntax category. A
+;;    limitation with Emacs regexps is that they only support word-start,
+;;    word-end, symbol-start and symbol-end zero-width matchers.
 ;;
 ;; 4. ambiguous tokens. e.g. the word "via" is a keyword in a specific 
location,
 ;;    but can otherwise be used as a varid. I'd like to be able to lex it as 
(or
diff --git a/haskell-tng-syntax.el b/haskell-tng-syntax.el
index 4946f76..205d42a 100644
--- a/haskell-tng-syntax.el
+++ b/haskell-tng-syntax.el
@@ -44,6 +44,10 @@
     ;;       letter)
     (modify-syntax-entry ?_ "w" table)
 
+    ;; TODO consider using categories more heavily, which would involve doing
+    ;; lexing here. It would make the fontification regexps simpler and faster,
+    ;; and would be reused by the SMIE lexer.
+
     ;; some special (treated like punctuation)
     (--each (string-to-list ",;")
       (modify-syntax-entry it "." table))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]