aboutsummaryrefslogtreecommitdiff
path: root/vm.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2020-12-12 16:31:53 -0800
committerBruce Hill <bruce@bruce-hill.com>2020-12-12 16:31:53 -0800
commiteb329bdac9fe56d67cb130fb6cdbb28743c6504b (patch)
tree8ba8bded07820519de06728618e4e32e80da3af4 /vm.h
parent6e1fd928148cc7e46015e06c27f824d4111f96ee (diff)
Bunch of changes, including some bpeg->bp renaming, and adding
visualizations
Diffstat (limited to 'vm.h')
-rw-r--r--vm.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/vm.h b/vm.h
index e0e6b5d..e862b79 100644
--- a/vm.h
+++ b/vm.h
@@ -11,6 +11,11 @@
#include "types.h"
+typedef enum {
+ PRINT_COLOR = 1<<0,
+ PRINT_LINE_NUMBERS = 1<<1,
+} print_options_t;
+
const char *opcode_name(enum VMOpcode o);
__attribute__((hot, nonnull))
match_t *match(grammar_t *g, file_t *f, const char *str, vm_op_t *op, unsigned int flags);
@@ -19,7 +24,9 @@ void destroy_match(match_t **m);
__attribute__((nonnull))
void print_pattern(vm_op_t *op);
__attribute__((nonnull))
-void print_match(file_t *f, match_t *m);
+void print_match(file_t *f, match_t *m, print_options_t options);
+__attribute__((nonnull))
+void json_match(FILE *f, const char *text, match_t *m);
#endif
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1