Implement while loops

This commit is contained in:
2024-12-28 14:33:35 +01:00
parent d46608b358
commit 20949c7829
7 changed files with 257 additions and 46 deletions

View File

@ -1,26 +1,32 @@
#include "elna/gcc/elna-diagnostic.h"
location_t elna_gcc_location(const elna::source::position *position)
namespace elna
{
linemap_line_start(line_table, position->line, 0);
return linemap_position_for_column(line_table, position->column);
}
const char *elna_gcc_print_type(tree type)
namespace gcc
{
gcc_assert(TYPE_P(type));
location_t get_location(const elna::source::position *position)
{
linemap_line_start(line_table, position->line, 0);
if (type == integer_type_node)
{
return "Int";
return linemap_position_for_column(line_table, position->column);
}
else if (type == boolean_type_node)
const char *print_type(tree type)
{
return "Boolean";
}
else
{
return "<<unknown-type>>";
gcc_assert(TYPE_P(type));
if (type == integer_type_node)
{
return "Int";
}
else if (type == boolean_type_node)
{
return "Boolean";
}
else
{
return "<<unknown-type>>";
}
}
}
}