Check for duplicate fields in the declaration visitor

This commit is contained in:
2025-03-15 23:01:05 +01:00
parent fa73f14070
commit f6e0ead4fb
9 changed files with 88 additions and 151 deletions

View File

@ -83,17 +83,10 @@ static void elna_parse_file(const char *filename)
}
else
{
std::shared_ptr<elna::gcc::symbol_table> symbol_table = std::make_shared<elna::gcc::symbol_table>();
std::shared_ptr<elna::boot::symbol_table> info_table = elna::boot::builtin_symbol_table();
std::shared_ptr<elna::gcc::symbol_table> symbol_table = elna::gcc::builtin_symbol_table();
symbol_table->enter("Int", elna_int_type_node);
symbol_table->enter("Word", elna_word_type_node);
symbol_table->enter("Char", elna_char_type_node);
symbol_table->enter("Bool", elna_bool_type_node);
symbol_table->enter("Byte", elna_byte_type_node);
symbol_table->enter("Float", elna_float_type_node);
symbol_table->enter("String", elna_string_type_node);
auto semantic_errors = elna::gcc::do_semantic_analysis(filename, driver.tree, symbol_table);
auto semantic_errors = elna::gcc::do_semantic_analysis(filename, driver.tree, info_table, symbol_table);
if (semantic_errors.empty())
{