aboutsummaryrefslogtreecommitdiff
path: root/printing.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-01-12 19:27:57 -0800
committerBruce Hill <bruce@bruce-hill.com>2021-01-12 19:27:57 -0800
commit8144ae5dc941cce599889c0feb15ecceb9e4f878 (patch)
tree64991885ab9f0d65c3f5964276aeac1020d10198 /printing.c
parent659ed934d297d0d21d141bc4e9ecf8519a390eb1 (diff)
Renamed op.op -> op.type
Diffstat (limited to 'printing.c')
-rw-r--r--printing.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/printing.c b/printing.c
index 02693b5..20289da 100644
--- a/printing.c
+++ b/printing.c
@@ -155,7 +155,7 @@ static void _visualize_matches(match_node_t *firstmatch, int depth, const char *
static void _visualize_patterns(match_t *m)
{
- if (m->op->op == VM_REF && streq(m->op->args.s, "pattern")) {
+ if (m->op->type == VM_REF && streq(m->op->args.s, "pattern")) {
m = m->child;
match_node_t first = {.m = m};
_visualize_matches(&first, 0, m->start, (size_t)(m->end - m->start));
@@ -191,12 +191,12 @@ static void _print_match(FILE *out, file_t *f, match_t *m, print_state_t *state,
{
static const char *hl = "\033[0;31;1m";
const char *old_color = state->color;
- if (m->op->op == VM_HIDE) {
+ if (m->op->type == VM_HIDE) {
// TODO: handle replacements?
for (const char *p = m->start; p < m->end; p++) {
if (*p == '\n') ++state->line;
}
- } else if (m->op->op == VM_REPLACE) {
+ } else if (m->op->type == VM_REPLACE) {
if (options & PRINT_COLOR && state->color != hl) {
state->color = hl;
fprintf(out, "%s", state->color);
@@ -236,7 +236,7 @@ static void _print_match(FILE *out, file_t *f, match_t *m, print_state_t *state,
}
}
} else {
- if (m->op->op == VM_CAPTURE) {
+ if (m->op->type == VM_CAPTURE) {
if (options & PRINT_COLOR && state->color != hl) {
state->color = hl;
fprintf(out, "%s", state->color);