From ffe6097c534c82b9402bb6f0a57abeebd075e61d Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Wed, 8 Jul 2026 11:04:34 +0200 Subject: Allow multiple fields with the same type --- boot/semantic.cc | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'boot/semantic.cc') diff --git a/boot/semantic.cc b/boot/semantic.cc index cd50742..bc7c2d2 100644 --- a/boot/semantic.cc +++ b/boot/semantic.cc @@ -272,15 +272,18 @@ namespace elna::boot for (auto& field : fields) { - if (field_names.find(field.first) != field_names.cend()) + field.second->accept(this); + for (auto& field_name : field.first) { - add_error(field.first, field.second->position()); - } - else - { - field_names.insert(field.first); - field.second->accept(this); - result.push_back(std::make_pair(field.first, this->current_type)); + if (field_names.find(field_name) != field_names.cend()) + { + add_error(field_name, field.second->position()); + } + else + { + field_names.insert(field_name); + result.push_back(std::make_pair(field_name, this->current_type)); + } } } return result; -- cgit v1.2.3