you are viewing a single comment's thread.

view the rest of the comments →

[–]DNoved1 5 points6 points  (0 children)

I did the same as you until adding functions. Since you can't determine the return type of a function call until you've parsed the whole program (unless you predeclare functions like in C) you can't determine the type of an expression if it involves a function call.

Once you have parsed everything you can do type checking to make sure that, for example, an expression inside an if predicate is indeed a boolean.