summaryrefslogtreecommitdiff
path: root/src/dfa.h
diff options
context:
space:
mode:
authorAlain Magloire <alainm@rcsm.ee.mcgill.ca>2001-02-08 17:21:55 +0000
committerAlain Magloire <alainm@rcsm.ee.mcgill.ca>2001-02-08 17:21:55 +0000
commit9409743bdac8ac0478f0746adccab2ddc0513eb0 (patch)
treedf7be26e507199f5b37649ad4734d8984c997b16 /src/dfa.h
parent5991f478a5a6f2f8d48be945857c53d39279212c (diff)
downloadgrep-9409743bdac8ac0478f0746adccab2ddc0513eb0.tar.gz
Range fixex.
Handle range expressions correctly even when they match strings with two or more characters. * src/dfa.h (CRANGE): New enum value. Comment fix. * src/dfa.c: Include <locale.h> if HAVE_SETLOCALE. Include "hard-locale.h". (prtok): Print CRANGE. (hard_LC_COLLATE): New static var. (lex): Return CRANGE when parsing a character range in a hard locale. Don't use strcoll; it's no longer needed and wasn't correct anyway. Use unsigned rather than token to hold unsigned chars. (addtok): Comment fix. (atom): Treat a CRANGE as if it were (.\1), approximately. (dfaparse): Initialize hard_LC_COLLATE. * src/Makefile.am (base_sources): Add hard-locale.c, hard-locale.h. * src/hard-locale.c, src/hard-locale.h: New files, taken from textutils.
Diffstat (limited to 'src/dfa.h')
-rw-r--r--src/dfa.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/dfa.h b/src/dfa.h
index dae3391e..cab659a5 100644
--- a/src/dfa.h
+++ b/src/dfa.h
@@ -142,6 +142,12 @@ typedef enum
RPAREN, /* RPAREN never appears in the parse tree. */
+ CRANGE, /* CRANGE never appears in the parse tree.
+ It stands for a character range that can
+ match a string of one or more characters.
+ For example, [a-z] can match "ch" in
+ a Spanish locale. */
+
CSET /* CSET and (and any value greater) is a
terminal symbol that matches any of a
class of characters. */
@@ -361,6 +367,5 @@ extern void dfastate PARAMS ((int, struct dfa *, int []));
/* dfaerror() is called by the regexp routines whenever an error occurs. It
takes a single argument, a NUL-terminated string describing the error.
- The default dfaerror() prints the error message to stderr and exits.
- The user can provide a different dfafree() if so desired. */
+ The user must supply a dfaerror. */
extern void dfaerror PARAMS ((const char *));