aboutsummaryrefslogtreecommitdiff
path: root/pattern.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-09-27 20:36:10 -0700
committerBruce Hill <bruce@bruce-hill.com>2021-09-27 20:36:10 -0700
commit911827fac3a53734c9a4a99c1b8ec2a689bc59d8 (patch)
tree5ac9e27f065b66ad613fbcac21c95f8b64706310 /pattern.h
parenta96284615b27226f4d34de8dfa7235f0c14ac1d4 (diff)
Removed definitions as a separate type and instead encode that value in
the patterns themselves. This simplifies memory management a lot and speeds up performance.
Diffstat (limited to 'pattern.h')
-rw-r--r--pattern.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/pattern.h b/pattern.h
index 3a78f13..a1f7043 100644
--- a/pattern.h
+++ b/pattern.h
@@ -34,7 +34,7 @@ enum pattype_e {
BP_END_OF_FILE = 22,
BP_END_OF_LINE = 23,
BP_WORD_BOUNDARY = 24,
- BP_DEFINITION = 25,
+ BP_DEFINITIONS = 25,
BP_LEFTRECURSION = 26,
};
@@ -57,7 +57,7 @@ typedef struct pat_s {
struct {
const char *name;
size_t namelen;
- struct pat_s *def, *pat;
+ struct pat_s *meaning, *next_def;
} def;
struct {
unsigned char low, high;