[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/tNFA 5f3bdf7 21/23: Enable lexical binding, and fix iss
From: |
Stefan Monnier |
Subject: |
[elpa] externals/tNFA 5f3bdf7 21/23: Enable lexical binding, and fix issues it picks up. |
Date: |
Mon, 14 Dec 2020 12:08:32 -0500 (EST) |
branch: externals/tNFA
commit 5f3bdf70531c0e2463f740601b3e5b752ae9f962
Author: Toby S. Cubitt <toby-predictive@dr-qubit.org>
Commit: Toby S. Cubitt <toby-predictive@dr-qubit.org>
Enable lexical binding, and fix issues it picks up.
---
tNFA.el | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/tNFA.el b/tNFA.el
index cb43f7d..7605481 100644
--- a/tNFA.el
+++ b/tNFA.el
@@ -1,3 +1,4 @@
+;; -*- lexical-binding: t; -*-
;;; tNFA.el --- Tagged non-deterministic finite-state automata
;; Copyright (C) 2008-2010, 2012 Free Software Foundation, Inc
@@ -322,7 +323,7 @@
;; create DFA state and add it to the state pool
(let ((DFA-state (tNFA--DFA-state--create
state-list state-pool :test test))
- tmp-list)
+ transition)
(puthash state-list DFA-state (tNFA--DFA-state-pool DFA-state))
(dolist (state state-list)
@@ -330,16 +331,20 @@
(cond
;; literal state: add literal transition
((eq (tNFA--state-type state) 'literal)
- (setq tmp-list (tNFA--DFA-state-transitions DFA-state))
- (add-to-list 'tmp-list (cons (tNFA--state-label state) t))
- (setf (tNFA--DFA-state-transitions DFA-state) tmp-list))
+ (setq transition (cons (tNFA--state-label state) t))
+ (unless (member transition (tNFA--DFA-state-transitions DFA-state))
+ (setf (tNFA--DFA-state-transitions DFA-state)
+ (append (tNFA--DFA-state-transitions DFA-state)
+ (list transition)))))
;; character alternative: add transitions for all alternatives
((eq (tNFA--state-type state) 'char-alt)
(dolist (c (tNFA--state-label state))
- (setq tmp-list (tNFA--DFA-state-transitions DFA-state))
- (add-to-list 'tmp-list (cons c t))
- (setf (tNFA--DFA-state-transitions DFA-state) tmp-list)))
+ (setq transition (cons c t))
+ (unless (member transition (tNFA--DFA-state-transitions DFA-state))
+ (setf (tNFA--DFA-state-transitions DFA-state)
+ (append (tNFA--DFA-state-transitions DFA-state)
+ (list transition))))))
;; wildcard or negated character alternative: add wildcard
;; transistion
- [elpa] externals/tNFA c9f0989 04/23: Converted transition hash tables to alists, (continued)
- [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, 2020/12/14
- [elpa] externals/tNFA 5f3bdf7 21/23: Enable lexical binding, and fix issues it picks up.,
Stefan Monnier <=
- [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