diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2022-04-30 15:23:02 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2022-04-30 15:23:02 -0400 |
| commit | 206e1fa68fb921d0fd8c9d31ec59a9b7d0fc2a5d (patch) | |
| tree | 916e508c47a30ed69c6e904479e642d12ec4d080 /json.c | |
| parent | 24ed834317f3fda8f0f55489f54a2df1aca5de17 (diff) | |
Added tagged definitions: `foo:: blah`
Diffstat (limited to 'json.c')
| -rw-r--r-- | json.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -30,6 +30,9 @@ static int _json_match(const char *text, match_t *m, int comma, bool verbose) } printf("\",\"range\":[%ld,%ld]", m->start - text, m->end - text); + if (m->pat->type == BP_TAGGED) + printf(",\"tag\":\"%.*s\"", (int)m->pat->args.capture.namelen, m->pat->args.capture.name); + if (m->children && (verbose || m->pat->type != BP_REF)) { printf(",\"children\":["); for (int i = 0; m->children && m->children[i]; i++) |
