Skip to content

Commit 293a04b

Browse files
committed
Accept indents in multiline commands
1 parent 428900b commit 293a04b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/lib/parser.leg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ pattern-properties = map-literal | parameter
753753

754754
client-command =
755755
< COLON -- n:client-command-name
756-
( '\\' -- line-end
756+
( '\\' -- line-end --
757757
| a:client-command-arg { sequence_add(a); }
758758
)*
759759
> { $$ = command(n); }

tests/check_command.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,19 +212,19 @@ END_TEST
212212
START_TEST (parse_multiline_command)
213213
{
214214
result = cypher_parse(
215-
":hunter \\ //firstname\ns \\\nthompson //lastname\n",
215+
":hunter \\ //firstname\ns \\\n \\\n thompson //lastname\n",
216216
NULL, NULL, 0);
217217
ck_assert_ptr_ne(result, NULL);
218218

219219
ck_assert(cypher_parse_result_fprint_ast(result, memstream, 0, NULL, 0) == 0);
220220
fflush(memstream);
221221
const char *expected = "\n"
222-
"@0 0..35 command name=@1, args=[@3, @4]\n"
222+
"@0 0..40 command name=@1, args=[@3, @4]\n"
223223
"@1 1..7 > string \"hunter\"\n"
224224
"@2 12..21 > line_comment //firstname\n"
225225
"@3 22..23 > string \"s\"\n"
226-
"@4 26..34 > string \"thompson\"\n"
227-
"@5 37..45 line_comment //lastname\n";
226+
"@4 31..39 > string \"thompson\"\n"
227+
"@5 42..50 line_comment //lastname\n";
228228
ck_assert_str_eq(memstream_buffer, expected);
229229
}
230230
END_TEST

0 commit comments

Comments
 (0)