Remove unnecessary pushing/popping for integer literal expressions
[fur] / main.py
diff --git a/main.py b/main.py
index be48e78..3045554 100644 (file)
--- a/main.py
+++ b/main.py
@@ -1,5 +1,8 @@
 import sys
 
+import conversion
+import crossplatform_ir_generation
+import desugaring
 import generation
 import normalization
 import parsing
@@ -13,8 +16,12 @@ with open(source_path, 'r') as f:
 
 tokens = tokenization.tokenize(source)
 parsed = parsing.parse(tokens)
-normalized = normalization.normalize(parsed)
-transformed = transformation.transform(normalized)
+desugared = desugaring.desugar(parsed)
+normalized = normalization.normalize(desugared)
+converted = conversion.convert(normalized)
+
+# This is the C generation path
+transformed = transformation.transform(converted)
 generated = generation.generate(transformed)
 
 assert source_path.endswith('.fur')
@@ -22,3 +29,8 @@ destination_path = source_path + '.c'
 
 with open(destination_path, 'w') as f:
     f.write(generated)
+
+# This is the crossplatform IR generation path
+crossplatform_ir = crossplatform_ir_generation.generate(converted)
+outputted = crossplatform_ir_generation.output(crossplatform_ir)
+print(outputted)