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

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

[elpa] externals/tNFA c5004e1 08/23: Updated docstrings for regexp-relat


From: Stefan Monnier
Subject: [elpa] externals/tNFA c5004e1 08/23: Updated docstrings for regexp-related functions and others.
Date: Mon, 14 Dec 2020 12:08:29 -0500 (EST)

branch: externals/tNFA
commit c5004e129d7ca72cb2ba3f069b9c80aa6eb7708d
Author: Toby Cubitt <toby-predictive@dr-qubit.org>
Commit: tsc25 <toby-predictive@dr-qubit.org>

    Updated docstrings for regexp-related functions and others.
---
 tNFA.el | 39 ++++++++++++++++++++++++++++++++-------
 1 file changed, 32 insertions(+), 7 deletions(-)

diff --git a/tNFA.el b/tNFA.el
index d8bae16..585418f 100644
--- a/tNFA.el
+++ b/tNFA.el
@@ -395,15 +395,25 @@
 
 (defun* tNFA-from-regexp (regexp &key (test 'eq))
   "Create a tagged NFA that recognizes the regular expression REGEXP.
-
-Back-references and non-greedy postfix operators are *not*
-supported, and the matches are always anchored, so `$' and `^'
-lose their special meanings.
-
 The return value is the initial state of the tagged NFA.
 
+REGEXP can be any sequence type (vector, list, or string); it
+need not be an actual string. Special characters in REGEXP are
+still just that: elements of the sequence that are characters
+which have a special meaning in regexps.
+
 The :test keyword argument specifies how to test whether two
-individual elements of STRING are identical. The default is `eq'."
+individual elements of STRING are identical. The default is `eq'.
+
+Only a subset of the full Emacs regular expression syntax is
+supported. There is no support for regexp constructs that are
+only meaningful for strings (character ranges and character
+classes inside character alternatives, and syntax-related
+backslash constructs). Back-references and non-greedy postfix
+operators are not supported, so `?' after a postfix operator
+loses its special meaning. Also, matches are always anchored, so
+`$' and `^' lose their special meanings (use `.*' at the
+beginning and end of the regexp to get an unanchored match)."
 
   ;; convert regexp to list, build NFA, and return initial state
   (declare (special NFA--state-id))
@@ -940,8 +950,23 @@ POS in a string."
 Sets the match data if there was a match; see `match-beginning',
 `match-end' and `match-string'.
 
+REGEXP and STRING can be any sequence type (vector, list, or
+string); they need not be actual strings. Special characters in
+REGEXP are still just that: elements of the sequence that are
+characters which have a special meaning in regexps.
+
 The :test keyword argument specifies how to test whether two
-individual elements of STRING are identical. The default is `eq'."
+individual elements of STRING are identical. The default is `eq'.
+
+Only a subset of the full Emacs regular expression syntax is
+supported. There is no support for regexp constructs that are
+only meaningful for strings (character ranges and character
+classes inside character alternatives, and syntax-related
+backslash constructs). Back-references and non-greedy postfix
+operators are not supported, so `?' after a postfix operator
+loses its special meaning. Also, matches are always anchored, so
+`$' and `^' lose their special meanings (use `.*' at the
+beginning and end of the regexp to get an unanchored match)."
 
   (let ((tNFA (tNFA-from-regexp regexp :test test))
        (i -1) tags match-data group-stack (grp 0))



reply via email to

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