AltoLang / Alto

Compiler in the works!
MIT License
3 stars 1 forks source link

Rework local functions #91

Open FilipToth opened 2 years ago

FilipToth commented 2 years ago

Background and Motivation

The local functions API is quite messy:

private Dictionary<BoundScope, List<Tuple<FunctionSymbol, BoundBlockStatement>>> _localFunctions = new Dictionary<BoundScope, List<Tuple<FunctionSymbol, BoundBlockStatement>>>();

It would be a good idea to rework this for clarity.

FilipToth commented 2 years ago

Probably just add a local functions field to the BoundScope API, this feels so dumb in retrospect :joy:.