IUCompilerCourse / Essentials-of-Compilation

A book about compiling Racket and Python to x86-64 assembly
1.28k stars 140 forks source link

chapter 7 python ed - mismatch between description and Lfun interpreter #103

Open proglang opened 2 years ago

proglang commented 2 years ago

The concrete syntax for Lfun says def ... stmt ... The ast says the same and it is explained like this in the text. However, the interpreter assumes that there are only definitions and invokes the main function.

jsiek commented 2 years ago

Ahh, that's because the interpreter only gets run after the shrink pass. But we should also be able to interpreter the source Lfun language. So yeah, the interpreter needs fixing.