From b93d8979bd9ea4148ea7e1d08d00ca846e151cf1 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 10 Sep 2020 22:42:47 -0700 Subject: Misc. tweaks and visualization changes, capitalized some rules --- bpeg.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'bpeg.h') diff --git a/bpeg.h b/bpeg.h index 7836250..459bd65 100644 --- a/bpeg.h +++ b/bpeg.h @@ -19,16 +19,6 @@ const char *usage = ( " -s --slow\t run in slow mode for debugging\n" " -r --replace replace the input pattern with the given replacement\n" " -g --grammar use the specified file as a grammar\n"); -/* - * Pattern matching result object - */ -typedef struct match_s { - // Where the match starts and ends (end is after the last character) - const char *start, *end; - unsigned int is_capture:1, is_replacement:1; - const char *name_or_replacement; - struct match_s *child, *nextsibling; -} match_t; /* * BPEG virtual machine opcodes @@ -85,6 +75,17 @@ typedef struct vm_op_s { } args; } vm_op_t; +/* + * Pattern matching result object + */ +typedef struct match_s { + // Where the match starts and ends (end is after the last character) + const char *start, *end; + unsigned int is_capture:1, is_replacement:1, is_ref:1; + const char *name_or_replacement; + struct match_s *child, *nextsibling; + vm_op_t *op; +} match_t; static inline const char *after_spaces(const char *str); static match_t *free_match(match_t *m); -- cgit v1.2.3