From 8746b638f0fe422dc7ba532c2b16d793438c0006 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 28 Jan 2019 19:39:12 -0800 Subject: @(next): Diagnose source combined with source-giving option. * match.c (v_next_impl): The check against the presence of multiple of source-specifying keyword options must also consider the base source as part of the mutual exclusion, so that syntax like @(next "file" :string "str") is also ruled out. --- match.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/match.c b/match.c index 5fce1696..972aae2b 100644 --- a/match.c +++ b/match.c @@ -2705,15 +2705,15 @@ static val v_next_impl(match_files_ctx *c) sem_error(specline, lit("next: source required before keyword arguments"), nao); { - int count = (from_var != nil) + + int count = (source != nil) + + (from_var != nil) + (list_expr != nil) + (tlist_expr != nil) + (string_expr != nil); if (count > 1) { - sem_error(specline, lit("next: only one of :var, :list, :tlist or :string " - "can be specified"), nao); + sem_error(specline, lit("next: at most one source may be specified"), nao); } } -- cgit v1.2.3