[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/tNFA 4771c2f 12/23: Redefined tNFA--NFA-state-create an
From: |
Stefan Monnier |
Subject: |
[elpa] externals/tNFA 4771c2f 12/23: Redefined tNFA--NFA-state-create and tNFA--NFA-state-create-tag using defun |
Date: |
Mon, 14 Dec 2020 12:08:30 -0500 (EST) |
branch: externals/tNFA
commit 4771c2f51b2ade8b8235efadf806b553c8a1172a
Author: Toby S. Cubitt <toby-predictive@dr-qubit.org>
Commit: Toby S. Cubitt <toby-predictive@dr-qubit.org>
Redefined tNFA--NFA-state-create and tNFA--NFA-state-create-tag using defun
to work around a mysterious byte-compiler bug somehow related to the dummy
argument used in the defstruct definitions of the same.
---
tNFA.el | 38 ++++++++++++++++++++++++++++----------
1 file changed, 28 insertions(+), 10 deletions(-)
diff --git a/tNFA.el b/tNFA.el
index 9cb273b..41d18c5 100644
--- a/tNFA.el
+++ b/tNFA.el
@@ -146,16 +146,17 @@
(tNFA--NFA-state
(:type vector)
(:constructor nil)
- (:constructor tNFA--NFA-state-create
+ (:constructor tNFA---NFA-state-create
(&optional type label next
&aux
(in-degree 0)
(count 0)
(id (incf NFA--state-id))
- (dummy
- (when next
- (setf (tNFA--NFA-state-count next)
- (incf (tNFA--NFA-state-in-degree next)))))))
+ ;; (dummy
+ ;; (when next
+ ;; (setf (tNFA--NFA-state-count next)
+ ;; (incf (tNFA--NFA-state-in-degree next)))))
+ ))
(:constructor tNFA--NFA-state-create-branch
(&rest next
&aux
@@ -163,7 +164,7 @@
(in-degree 0)
(count 0)
(id (incf NFA--state-id))))
- (:constructor tNFA--NFA-state-create-tag
+ (:constructor tNFA---NFA-state-create-tag
(tag &optional next
&aux
(type 'tag)
@@ -171,16 +172,33 @@
(in-degree 0)
(count 0)
(id (incf NFA--state-id))
- (dummy
- (when next
- (setf (tNFA--NFA-state-count next)
- (incf (tNFA--NFA-state-in-degree next)))))))
+ ;; (dummy
+ ;; (when next
+ ;; (setf (tNFA--NFA-state-count next)
+ ;; (incf (tNFA--NFA-state-in-degree next)))))
+ ))
(:copier nil))
id type label in-degree
count tNFA-state ; used internally in NFA evolution algorithms
next)
+;; Define these via defun instead of using the dummy argument in the
+;; above defstruct to work around a mysterious byte-compiler bug.
+
+(defun tNFA--NFA-state-create (&optional type label next)
+ (when next
+ (setf (tNFA--NFA-state-count next)
+ (incf (tNFA--NFA-state-in-degree next))))
+ (tNFA---NFA-state-create type label next))
+
+(defun tNFA--NFA-state-create-tag (tag &optional next)
+ (when next
+ (setf (tNFA--NFA-state-count next)
+ (incf (tNFA--NFA-state-in-degree next))))
+ (tNFA---NFA-state-create-tag tag next))
+
+
;; tag number for a tagged epsilon transition is stored in label slot
(defalias 'tNFA--NFA-state-tag 'tNFA--NFA-state-label)
- [elpa] externals/tNFA 892122c 23/23: Tidy up unnecessary macros by making them into defsubst or defun., (continued)
- [elpa] externals/tNFA 892122c 23/23: Tidy up unnecessary macros by making them into defsubst or defun., Stefan Monnier, 2020/12/14
- [elpa] externals/tNFA c9f0989 04/23: Converted transition hash tables to alists, Stefan Monnier, 2020/12/14
- [elpa] externals/tNFA 74b68dd 16/23: Updated copyright attribution and license (GPL2 -> GPL3)., Stefan Monnier, 2020/12/14
- [elpa] externals/tNFA 241dd74 03/23: Bug-fix in tNFA--from-regexp; added public tNFA-group-data function., Stefan Monnier, 2020/12/14
- [elpa] externals/tNFA 9e1ca74 13/23: Added changelog entries, and bumped tNFA version number., Stefan Monnier, 2020/12/14
- [elpa] externals/tNFA 83ab8b3 10/23: Re-filled to 72 chars/line, for mailing to gnu-emacs-sources list, Stefan Monnier, 2020/12/14
- [elpa] externals/tNFA b457403 14/23: Trivial docstring and comment fixes., Stefan Monnier, 2020/12/14
- [elpa] externals/tNFA 1af1e58 22/23: Implement trie-fuzzy-match and trie-fuzzy-complete functions., Stefan Monnier, 2020/12/14
- [elpa] externals/tNFA 7b44eeb 02/23: Bug-fix in tNFA--from-regexp: add tag transitions *outside* their group fragment,, Stefan Monnier, 2020/12/14
- [elpa] externals/tNFA 5463a53 07/23: Bug-fix to \{...\} postfix operator processing in tNFA--from-regexp, Stefan Monnier, 2020/12/14
- [elpa] externals/tNFA 4771c2f 12/23: Redefined tNFA--NFA-state-create and tNFA--NFA-state-create-tag using defun,
Stefan Monnier <=
- [elpa] externals/tNFA 5f3bdf7 21/23: Enable lexical binding, and fix issues it picks up., Stefan Monnier, 2020/12/14
- [elpa] externals/tNFA 7e38f4c 19/23: Add missing autoload cookies., Stefan Monnier, 2020/12/14
- [elpa] externals/tNFA 454c544 09/23: Added commentary, Stefan Monnier, 2020/12/14
- [elpa] externals/tNFA 9a742f6 01/23: Implementation of tagged non-deterministic finite state automata, for regular expression matching, Stefan Monnier, 2020/12/14
- [elpa] externals/tNFA b035e48 11/23: Removed left-over debugging code and other minor tidying., Stefan Monnier, 2020/12/14
- [elpa] externals/tNFA ff30781 18/23: More minor whitespace and commentary changes., Stefan Monnier, 2020/12/14
- [elpa] externals/tNFA c5004e1 08/23: Updated docstrings for regexp-related functions and others., Stefan Monnier, 2020/12/14
- [elpa] externals/tNFA 87c6223 15/23: Updated Package-Version, Package-Requires, and Keywords package headers., Stefan Monnier, 2020/12/14