JSAbrahams / mamba

🐍 The Mamba programming language, because we care about safety
MIT License
85 stars 3 forks source link

More elegantly print out language primtives in error messages #217

Closed JSAbrahams closed 2 years ago

JSAbrahams commented 2 years ago

Current Issue

Language primitives are not printed nicely

High-level description of the feature

In, say an error message, if something expects an integer, it should just say 'an integer'. Best way to implement it is to, in the print function of an integer node (in parse/ast), do a check to see if the internal string is empty. If it is, then it should say something along the lines of 'an integer'. This functionality could also be re-used in other settings then, perhaps.