Restructuring the parser & split parser into parts. Parsing more constructs now, like enums with extended syntax. Corrected handling of function block to be an expression. Added expression block codegen.

This commit is contained in:
Christoffer Lerno
2020-03-14 12:22:31 +01:00
parent 2e3bbf119c
commit f4b4bab947
31 changed files with 4482 additions and 4048 deletions

View File

@@ -3,9 +3,9 @@ module map(Key, Type);
public struct Entry
{
Key key;
Type *value;
Type* value;
usize hash;
Entry *next;
Entry* next;
}
public struct Map
@@ -92,10 +92,10 @@ public macro Vector.foreach(Vector *vector, macro void(Type value) body)
test
{
define IntVector = Vector(int);
IntVector *vector = @calloc(IntVector);
IntVector vector = vector.init();
vector.add(1);
vector.add(2);
foreach (int i : vector)
for (int i : vector)
{
printDigit(i);
}
@@ -103,4 +103,5 @@ test
{
printDigit(i);
}
vector.destroy();
}