aboutsummaryrefslogtreecommitdiff
path: root/boot/semantic.cc
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-07-08 11:04:34 +0200
committerEugen Wissner <belka@caraus.de>2026-07-08 11:04:34 +0200
commitffe6097c534c82b9402bb6f0a57abeebd075e61d (patch)
tree9079255db89007046fe1446d27009df8585a154e /boot/semantic.cc
parent79521d91b2bb85652fd29f5c44279338d55c757f (diff)
downloadelna-ffe6097c534c82b9402bb6f0a57abeebd075e61d.tar.gz
Allow multiple fields with the same type
Diffstat (limited to 'boot/semantic.cc')
-rw-r--r--boot/semantic.cc19
1 files changed, 11 insertions, 8 deletions
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_duplication_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_duplication_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;