diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2021-08-28 16:05:30 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2021-08-28 16:05:30 -0700 |
| commit | f8860c385ee35e50c716e2119131103fdb6fd70e (patch) | |
| tree | 3f45681dbf519285680c421cdf14ee13d7059100 /json.c | |
| parent | d44806f746b22311a04e45a80a9281d4f4f3a71d (diff) | |
Style change: added cino=:0 (i.e. case statements on same indentation as
switch). Also fixed issue where $$ would fail to match with trailing
newline on file
Diffstat (limited to 'json.c')
| -rw-r--r-- | json.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -29,11 +29,11 @@ static int _json_match(const char *text, match_t *m, int comma, bool verbose) printf("{\"rule\":\""); for (const char *c = m->pat->start; c < m->pat->end; c++) { switch (*c) { - case '"': printf("\\\""); break; - case '\\': printf("\\\\"); break; - case '\t': printf("\\t"); break; - case '\n': printf("↵"); break; - default: printf("%c", *c); break; + case '"': printf("\\\""); break; + case '\\': printf("\\\\"); break; + case '\t': printf("\\t"); break; + case '\n': printf("↵"); break; + default: printf("%c", *c); break; } } printf("\",\"start\":%ld,\"end\":%ld,\"children\":[", @@ -52,4 +52,4 @@ void json_match(const char *text, match_t *m, bool verbose) (void)_json_match(text, m, 0, verbose); } -// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1 +// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0 |
