projects
/
idzebra-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bug fix: Leading and trailing white space weren't removed in scan tokens.
[idzebra-moved-to-github.git]
/
dfa
/
dfa.c
diff --git
a/dfa/dfa.c
b/dfa/dfa.c
index
ffe11f3
..
276ca06
100644
(file)
--- a/
dfa/dfa.c
+++ b/
dfa/dfa.c
@@
-4,7
+4,13
@@
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: dfa.c,v $
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: dfa.c,v $
- * Revision 1.12 1996-06-04 10:20:02 adam
+ * Revision 1.14 1996-10-29 13:57:22 adam
+ * Include of zebrautl.h instead of alexutil.h.
+ *
+ * Revision 1.13 1996/06/17 14:24:08 adam
+ * Bug fix: read_charset didn't handle character mapping.
+ *
+ * Revision 1.12 1996/06/04 10:20:02 adam
* Added support for character mapping.
*
* Revision 1.11 1996/01/08 19:15:24 adam
* Added support for character mapping.
*
* Revision 1.11 1996/01/08 19:15:24 adam
@@
-51,7
+57,7
@@
#include <string.h>
#include <ctype.h>
#include <string.h>
#include <ctype.h>
-#include <alexutil.h>
+#include <zebrautl.h>
#include "dfap.h"
#include "imalloc.h"
#include "dfap.h"
#include "imalloc.h"
@@
-405,6
+411,15
@@
static int read_charset (void)
{
if (!esc0 && ch0 == ']')
break;
{
if (!esc0 && ch0 == ']')
break;
+ if (parse_info->cmap)
+ {
+ char **mapto, mapfrom[2];
+ const char *mcp = mapfrom;
+ mapfrom[0] = ch0;
+ mapto = (*parse_info->cmap)(&mcp, 1);
+ assert (mapto);
+ ch0 = mapto[0][0];
+ }
add_BSet (parse_info->charset, look_chars, ch0);
ch1 = nextchar_set (&esc1);
if (!esc1 && ch1 == '-')
add_BSet (parse_info->charset, look_chars, ch0);
ch1 = nextchar_set (&esc1);
if (!esc1 && ch1 == '-')
@@
-416,6
+431,15
@@
static int read_charset (void)
add_BSet (parse_info->charset, look_chars, '-');
break;
}
add_BSet (parse_info->charset, look_chars, '-');
break;
}
+ if (parse_info->cmap)
+ {
+ char **mapto, mapfrom[2];
+ const char *mcp = mapfrom;
+ mapfrom[0] = ch1;
+ mapto = (*parse_info->cmap) (&mcp, 1);
+ assert (mapto);
+ ch1 = mapto[0][0];
+ }
for (i=ch0; ++i<=ch1;)
add_BSet (parse_info->charset, look_chars, i);
ch0 = nextchar_set (&esc0);
for (i=ch0; ++i<=ch1;)
add_BSet (parse_info->charset, look_chars, i);
ch0 = nextchar_set (&esc0);
@@
-434,7
+458,7
@@
static int read_charset (void)
static int map_l_char (void)
{
char **mapto;
static int map_l_char (void)
{
char **mapto;
- const char *cp0 = expr_ptr-1;
+ const char *cp0 = (const char *) (expr_ptr-1);
int i = 0, len = strlen(cp0);
if (cp0[0] == 1 && cp0[1])
int i = 0, len = strlen(cp0);
if (cp0[0] == 1 && cp0[1])
@@
-449,7
+473,7
@@
static int map_l_char (void)
mapto = (*parse_info->cmap) (&cp0, len);
assert (mapto);
mapto = (*parse_info->cmap) (&cp0, len);
assert (mapto);
- expr_ptr = cp0;
+ expr_ptr = (const unsigned char *) cp0;
look_ch = mapto[i][0];
logf (LOG_DEBUG, "map from %c to %d", expr_ptr[-1], look_ch);
return L_CHAR;
look_ch = mapto[i][0];
logf (LOG_DEBUG, "map from %c to %d", expr_ptr[-1], look_ch);
return L_CHAR;