-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What are the types of compiler errors? #242
Comments
@mhagmajer I would create a class hierarchy for them, e.g.:
RuntimeError with subclasses, each error type being a separate subclass, e.g.:
|
@czerwinskilukasz1 why class hierarchy and not plan object with type? Maybe we should avoid OOP to make it easier to port AskVM to non-oop languages such as C |
@mhagmajer , I am fine with either, with a preference for classes, because they make the code more reusable and cleaner. If we were to port AskVM to other languages, we would need much work anyway as we are using pretty many Typescript and Javascript features, like:
|
These are all functions. I'm not sure how to reflect class hierarchy in AskScript while not introducing classes. Maybe with explicit prototypal inheritance? |
I don't think there is prototypal inheritance in C. |
@czerwinskilukasz1 prototypal inheritance is actually pretty easy to implement - you just need a pointer for the prototype. We use it for creating new environment (scope) when running functions |
What are the types of errors that
run
andparse
can throw?The text was updated successfully, but these errors were encountered: