-
Notifications
You must be signed in to change notification settings - Fork 4
(feat) AST->HIR Code prep #53
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
Conversation
89e1d65
to
fc5d8e2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have time to look at this in depth, but in general nothing looks out of the ordinary. I do think that error handling methodology could be improved, and from my experience having that done well is super helpful when actually doing the compilation (where a lot of stuff can go wrong)
This PR solves a bunch of problems in the DSL/HIR to allow for the initial transformation from AST -> HIR. Notably:
$
and*
type extensions in the parser & type system.Type$
stands for Costed(Type) is covariant and inherits Stored(Type)Type*
stands for Stored(Type) is covariant and inherits Type.Adds an implementation of map in the HIR and the engine where the keys are allowed to be hashed and compared against each other.
Adds
#
to distinguish between field accesses in structs, and member function calls (with.
).Fixes the
Call
evaluate engine function to include indexing arrays, tuples, maps, and operators (including a group/goal expansion when field access is needed).Added the
Never
type for the Fail expression in the type system.