-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add support for prelude files #160
Conversation
02ebf8e
to
c534bb3
Compare
(V0 messed up the lang inference exception handling, it is fixed now, sorry for the noise) |
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 think we're almost there: I left a few comments, but aside from that I think we're missing some kind of tests to check whether this is working as intended. The simplest would probably be to add a --prelude
option to the dolmen cli and use it in a test, for instance to test a combination of the ae fpa prelude and a smtlib2 file ?
You might need to rebase on |
e109bbd
to
e685dc6
Compare
808150b
to
929b753
Compare
@Gbury This should be good to go now |
This improves Dolmen's prelude support by allowing to provide preludes as files, rather than as statements. The prelude files are parsed separately from the main file, and can use a different language from the main file. The `logic_file` is reset to the appropriate file during statement generation to ensure that the typer always uses the right language. Since a single pipe is now expected to potentially include statements from different languages, the `additional_builtins` in the typer is passed the current language as an additional argument, allowing to define language-specific additional builtins. Since this is already a breaking change, `additional_builtins` is also changed from a reference to a `State` key for consistency with the rest of Dolmen's API.
929b753
to
633c6bd
Compare
Compatibility with the changes in Gbury/dolmen#160
Compatibility with the changes in Gbury/dolmen#160
This improves Dolmen's prelude support by allowing to provide preludes as files, rather than as statements.
The prelude files are parsed separately from the main file, and can use a different language from the main file. The
logic_file
is reset to the appropriate file during statement generation to ensure that the typer always uses the right language.Since a single pipe is now expected to potentially include statements from different languages, the
additional_builtins
in the typer is passed the current language as an additional argument, allowing to define language-specific additional builtins. Since this is already a breaking change,additional_builtins
is also changed from a reference to aState
key for consistency with the rest of Dolmen's API.