[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/tNFA 3835750 17/23: Trivial whitespace tidying.
From: |
Stefan Monnier |
Subject: |
[elpa] externals/tNFA 3835750 17/23: Trivial whitespace tidying. |
Date: |
Mon, 14 Dec 2020 12:08:31 -0500 (EST) |
branch: externals/tNFA
commit 3835750a462fef0ba6b42b2bb144d4760a3d5b6e
Author: Toby S. Cubitt <toby-predictive@dr-qubit.org>
Commit: Toby S. Cubitt <toby-predictive@dr-qubit.org>
Trivial whitespace tidying.
---
tNFA.el | 93 +++++++++++++++++++++++++++++++----------------------------------
1 file changed, 44 insertions(+), 49 deletions(-)
diff --git a/tNFA.el b/tNFA.el
index 1b1c332..307d668 100644
--- a/tNFA.el
+++ b/tNFA.el
@@ -1,4 +1,3 @@
-
;;; tNFA.el --- tagged non-deterministic finite-state automata
@@ -10,65 +9,63 @@
;; tNFA, NFA, DFA, finite state automata, automata, regexp
;; Package-Requires: ((queue "0.1"))
;; URL: http://www.dr-qubit.org/emacs.php
-
+;; Repository: http://www.dr-qubit.org/git/predictive.git
;; This file is part of Emacs.
;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
+;; GNU Emacs is free software: you can redistribute it and/or modify it under
+;; the terms of the GNU General Public License as published by the Free
+;; Software Foundation, either version 3 of the License, or (at your option)
+;; any later version.
;;
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
+;; GNU Emacs is distributed in the hope that it will be useful, but WITHOUT
+;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+;; more details.
;;
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
+;; You should have received a copy of the GNU General Public License along
+;; with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
-;; A tagged, non-deterministic finite state automata (NFA) is an
-;; abstract computing machine that recognises regular languages. In
-;; layman's terms, they are used to decide whether a string matches a
-;; regular expression. The "tagged" part allows the NFA to do
-;; group-capture: it returns information about which parts of a string
-;; matched which subgroup of the regular expression.
+;; A tagged, non-deterministic finite state automata (NFA) is an abstract
+;; computing machine that recognises regular languages. In layman's terms,
+;; they are used to decide whether a string matches a regular expression. The
+;; "tagged" part allows the NFA to do group-capture: it returns information
+;; about which parts of a string matched which subgroup of the regular
+;; expression.
;;
;; Why re-implement regular expression matching when Emacs comes with
-;; extensive built-in support for regexps? Primarily, because some
-;; algorithms require access to the NFA states produced part way through
-;; the regular expression matching process (see the trie.el package for
-;; an example). Secondarily, because Emacs regexps only work on strings,
-;; whereas regular expressions can usefully be used in Elisp code to
-;; match other sequence types, not just strings.
+;; extensive built-in support for regexps? Primarily, because some algorithms
+;; require access to the NFA states produced part way through the regular
+;; expression matching process (see the trie.el package for an
+;; example). Secondarily, because Emacs regexps only work on strings, whereas
+;; regular expressions can usefully be used in Elisp code to match other
+;; sequence types, not just strings.
;;
;; A tagged NFA can be created from a regular expression using
;; `tNFA-from-regexp', and its state can be updated using
-;; `tNFA-next-state'. You can discover whether a state is a matching
-;; state using `tNFA-match-p', extract subgroup capture data from it
-;; using `tNFA-group-data', check whether a state has any wildcard
-;; transitions using `tNFA-wildcard-p', and get a list of non-wildcard
-;; transitions using `tNFA-transitions'. Finally, `tNFA-regexp-match'
-;; uses tagged NFAs to decide whether a regexp matches a given string.
+;; `tNFA-next-state'. You can discover whether a state is a matching state
+;; using `tNFA-match-p', extract subgroup capture data from it using
+;; `tNFA-group-data', check whether a state has any wildcard transitions using
+;; `tNFA-wildcard-p', and get a list of non-wildcard transitions using
+;; `tNFA-transitions'. Finally, `tNFA-regexp-match' uses tagged NFAs to decide
+;; whether a regexp matches a given string.
;;
;; Note that Emacs' regexps are not regular expressions in the original
-;; meaning of that phrase. Emacs regexps implement additional features
-;; (in particular, back-references) that allow them to match far more
-;; than just regular languages. This comes at a cost: regexp matching
-;; can potentially be very slow (NP-hard in fact, though the hard cases
-;; rarely crop up in practise), whereas there are efficient
-;; (polynomial-time) algorithms for matching regular expressions (in the
-;; original sense). Therefore, this package only supports a subset of
-;; the full Emacs regular expression syntax. See the function docstrings
-;; for more information.
+;; meaning of that phrase. Emacs regexps implement additional features (in
+;; particular, back-references) that allow them to match far more than just
+;; regular languages. This comes at a cost: regexp matching can potentially be
+;; very slow (NP-hard in fact, though the hard cases rarely crop up in
+;; practise), whereas there are efficient (polynomial-time) algorithms for
+;; matching regular expressions (in the original sense). Therefore, this
+;; package only supports a subset of the full Emacs regular expression
+;; syntax. See the function docstrings for more information.
;;
-;; This package essentially implements Laurikari's algorithm, as
-;; described in his master's thesis, but it builds the corresponding
-;; tagged deterministic finite state automaton (DFA) on-the-fly as
-;; needed.
+;; This package essentially implements Laurikari's algorithm, as described in
+;; his master's thesis, but it builds the corresponding tagged deterministic
+;; finite state automaton (DFA) on-the-fly as needed.
;;
;; This package uses the queue package queue.el.
@@ -77,8 +74,8 @@
;;
;; Version 0.1.1
;; * work-around mysterious byte-compiler bug by defining
-;; `tNFA--NFA-state-create' and `tNFA--NFA-state-create-tag' via
-;; `defun' instead of directly in `defstruct'
+;; `tNFA--NFA-state-create' and `tNFA--NFA-state-create-tag' via `defun'
+;; instead of directly in `defstruct'
;;
;; Version 0.1
;; * initial version
@@ -89,7 +86,6 @@
(eval-when-compile (require 'cl))
(require 'queue)
-(provide 'tNFA)
@@ -1110,8 +1106,7 @@ beginning and end of the regexp to get an unanchored
match)."
(tNFA--tags-to-groups (tNFA--DFA-state-match tNFA)))
-;;; Local Variables:
-;;; fill-column: 72
-;;; End:
+
+(provide 'tNFA)
;;; tNFA.el ends here
- [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 <=
- [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, 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