-
Notifications
You must be signed in to change notification settings - Fork 144
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
Feature request: output AST in the SDK #268
Comments
Sounds cool! |
Sounds a bit like #463. We've been discussing enabling extensions using the ASTVisitor trait (see https://github.com/hirosystems/clarity-repl/blob/develop/src/analysis/ast_visitor.rs). I will work on this soon. |
Ignore my last comment. I discussed with @lgalabru and now understand that defining a plugin in Rust is not what we're looking for here. We can just expose the AST in Typescript (and maybe later create an ASTVisitor for Typescript). |
@obycode wondering if there have been any follow-up discussions on this feature request? I would love to include a SIP013 validator script for stacksgov/sips#42. With the AST exposed, I could make a script that checks:
|
Hi @MarvinJanssen. I have not been able to prioritize this yet. How urgent is your need? |
@obycode Not sure, it is definitely not a requirement for SIP013 or the other SIP we will be working on at the Lab. However, it would definitely be cool. Is it a lot of work? Maybe I could take a crack at it. Anything in Rust just takes ages for me to figure out. |
I'm not really sure what kind of effort this will take. I have not looked at this code path yet. I'm going to take a look now... |
I think the key task for this is going to be figuring out how to represent the AST in the JSON (which gets passed from Rust to Typescript). |
Is this still need? |
clarinet run
I slightly repurposed this issue following the deprecation of clarinet run and the release of clarinet sdk |
Addressed in #1162 |
Asking for the possibility of receiving contract AST in
clarinet run
. I remember one of the very early versions of this command having the capability (although I might be wrong).I want to make a simplistic analyser that checks if a given contract conforms to the SIP-013 semi-fungible token standard stacksgov/sips#42.
The SIP defines parameters that cannot be captured by mere trait compliance. I wanted to use the AST to check if there is some usage of specific Clarity primitives; including, but not limited to:
transfer
calls bothft-transfer?
andnft-burn?
.If it works, I am even thinking about generalising such a check system into a separate SIP. Then future SIPs that describe contracts could add a reference trait as well as an AST check. (Cool future feature for Clarinet as well?)
The text was updated successfully, but these errors were encountered: