-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 option to forge build
to only get the AST without compiling to bytecode
#7212
Comments
This is not strictly blocked by ethereum/solidity#15043 as additional stages would be trivial to add but it may be premature considering the original use case needs a semantic stage. |
@klkvr Is there a way to not request |
--stop-after parsing
to pass to solc and only get the AST without compiling to bytecodeforge build
to only get the AST without compiling to bytecode
I wonder if adding a flag for bytecode (and defaulting it on) would help with this? then you could do something like We'd love to have this in https://github.com/latticexyz/mud so we replace our dependency on https://github.com/solidity-parser/parser (which has subpar syntax error output) |
I'm now thinking what I'd prefer is actually just a |
Component
Forge
Describe the feature you would like
UPDATE see #7212 (comment)
I would like the forge build command to expose this, so one can pass
--stop-after parsing
solc and only get the AST without compiling to bytecodeAs a potential optimization, foundry could look if the solidity files' content is unchanged and reuse the AST on disk for compilation by giving them to solc when
forge build --stop-after parsing && forge build/test
is run.Additional context
from https://github.com/ethereum/solidity/blob/develop/docs/using-the-compiler.rst#compiler-input-and-output-json-description:
The text was updated successfully, but these errors were encountered: