[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/tNFA 892122c 23/23: Tidy up unnecessary macros by makin
From: |
Stefan Monnier |
Subject: |
[elpa] externals/tNFA 892122c 23/23: Tidy up unnecessary macros by making them into defsubst or defun. |
Date: |
Mon, 14 Dec 2020 12:08:32 -0500 (EST) |
branch: externals/tNFA
commit 892122c94889aca6d0453b2f1dbb212ff8919150
Author: Toby S. Cubitt <toby-predictive@dr-qubit.org>
Commit: Toby S. Cubitt <toby-predictive@dr-qubit.org>
Tidy up unnecessary macros by making them into defsubst or defun.
---
tNFA.el | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/tNFA.el b/tNFA.el
index 370d6eb..59b91c0 100644
--- a/tNFA.el
+++ b/tNFA.el
@@ -131,7 +131,7 @@
;;; ----------------------------------------------------------------
;;; NFA states
-(declare (special NFA--state-id))
+(defvar NFA--state-id)
(defstruct
(tNFA--NFA-state
@@ -193,8 +193,8 @@
;; tag number for a tagged epsilon transition is stored in label slot
(defalias 'tNFA--NFA-state-tag 'tNFA--NFA-state-label)
-(defmacro tNFA--NFA-state-tags (state)
- `(tNFA--state-tags (tNFA--NFA-state-tNFA-state ,state)))
+(defsubst tNFA--NFA-state-tags (state)
+ (tNFA--state-tags (tNFA--NFA-state-tNFA-state state)))
(defun tNFA--NFA-state-patch (attach state)
@@ -406,19 +406,19 @@
vec))
-(defmacro tNFA--tags-set (tags tag val)
+(defsubst tNFA--tags-set (tags tag val)
;; set value of TAG in TAGS table to VAL
- `(setcar (aref ,tags ,tag) ,val))
+ (setcar (aref tags tag) val))
-(defmacro tNFA--tags-get (tags tag)
+(defsubst tNFA--tags-get (tags tag)
;; get value of TAG in TAGS table
- `(car (aref ,tags ,tag)))
+ (car (aref tags tag)))
-(defmacro tNFA--tags-type (tags tag)
+(defsubst tNFA--tags-type (tags tag)
;; return tag type ('min or 'max)
- `(cdr (aref ,tags ,tag)))
+ (cdr (aref tags tag)))
(defun tNFA--tags< (val tag tags)
@@ -499,15 +499,15 @@ beginning and end of the regexp to get an unanchored
match)."
)))
-(defmacro tNFA--regexp-postfix-p (regexp)
+(defsubst tNFA--regexp-postfix-p (regexp)
;; return t if next token in REGEXP is a postfix operator, nil
;; otherwise
- `(or (eq (car ,regexp) ?*)
- (eq (car ,regexp) ?+)
- (eq (car ,regexp) ??)
- (and (eq (car ,regexp) ?\\)
- (cdr ,regexp)
- (eq (cadr ,regexp) ?{))))
+ (or (eq (car regexp) ?*)
+ (eq (car regexp) ?+)
+ (eq (car regexp) ??)
+ (and (eq (car regexp) ?\\)
+ (cdr regexp)
+ (eq (cadr regexp) ?{))))
(defun tNFA--from-regexp (regexp num-tags min-tags max-tags
- [elpa] branch externals/tNFA created (now 892122c), Stefan Monnier, 2020/12/14
- [elpa] externals/tNFA 014847d 05/23: Bumped copyright year, Stefan Monnier, 2020/12/14
- [elpa] externals/tNFA f150b88 06/23: Added support for \{...\} postfix repetition operator, Stefan Monnier, 2020/12/14
- [elpa] externals/tNFA 3835750 17/23: Trivial whitespace tidying., Stefan Monnier, 2020/12/14
- [elpa] externals/tNFA 664c98e 20/23: Remove ChangeLogs from library headers., Stefan Monnier, 2020/12/14
- [elpa] externals/tNFA 892122c 23/23: Tidy up unnecessary macros by making them into defsubst or defun.,
Stefan Monnier <=
- [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