summaryrefslogtreecommitdiffstats
path: root/eval
diff options
context:
space:
mode:
authorHåvard Pettersen <havardpe@oath.com>2019-11-14 11:47:19 +0000
committerHåvard Pettersen <havardpe@oath.com>2019-11-14 11:47:19 +0000
commit0e1b141df9b55703474be179af938b33be86f048 (patch)
tree7d37c826735a78a2d5310d9592d4db43173da57b /eval
parent52b268b7b9e27ff34eb5d38bccfa807fdf27e267 (diff)
use comma tracker one more place
Diffstat (limited to 'eval')
-rw-r--r--eval/src/vespa/eval/eval/function.cpp5
-rw-r--r--eval/src/vespa/eval/eval/string_stuff.h1
2 files changed, 3 insertions, 3 deletions
diff --git a/eval/src/vespa/eval/eval/function.cpp b/eval/src/vespa/eval/eval/function.cpp
index 75d63ea7415..44bb61abe17 100644
--- a/eval/src/vespa/eval/eval/function.cpp
+++ b/eval/src/vespa/eval/eval/function.cpp
@@ -479,10 +479,9 @@ std::vector<vespalib::string> get_ident_list(ParseContext &ctx, bool wrapped) {
ctx.skip_spaces();
ctx.eat('(');
}
+ CommaTracker ident_list(wrapped);
while (!ctx.find_list_end()) {
- if (!list.empty() || !wrapped) {
- ctx.eat(',');
- }
+ ident_list.maybe_eat_comma(ctx);
list.push_back(get_ident(ctx, false));
}
if (wrapped) {
diff --git a/eval/src/vespa/eval/eval/string_stuff.h b/eval/src/vespa/eval/eval/string_stuff.h
index 3cbc7c9d35b..820196fe959 100644
--- a/eval/src/vespa/eval/eval/string_stuff.h
+++ b/eval/src/vespa/eval/eval/string_stuff.h
@@ -15,6 +15,7 @@ namespace vespalib::eval {
struct CommaTracker {
bool first;
CommaTracker() : first(true) {}
+ CommaTracker(bool first_in) : first(first_in) {}
bool maybe_add_comma(vespalib::string &dst) {
if (first) {
first = false;