From f8860c385ee35e50c716e2119131103fdb6fd70e Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 28 Aug 2021 16:05:30 -0700 Subject: 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 --- json.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'json.c') diff --git a/json.c b/json.c index 23079a7..e102cfe 100644 --- a/json.c +++ b/json.c @@ -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 -- cgit v1.2.3