Skip to content

Conversation

jtran
Copy link
Contributor

@jtran jtran commented Aug 28, 2025

Part of #8185.

Adds a new AST node type called SketchBlock and parsing it the same as a function call, followed by a curly brace delimited block. This intentionally reuses existing code. This PR doesn't add any other new sketch block parsing features like var or ==.

@settings(experimentalFeatures = allow)

sketch(XY, keywordArgs = "they parse") {
  // Code here
}

Both parse and execution warnings are generated. You can use @settings(experimentalFeatures = allow) to turn them off.

Execution isn't done. Even evaluating arguments isn't done.

I've used the string TODO: sketch-api: to indicate things that we should come back to.

This should make #4015 easier.

Copy link

vercel bot commented Aug 28, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
modeling-app Ready Ready Preview Comment Aug 30, 2025 1:27am

Copy link

codspeed-hq bot commented Aug 28, 2025

CodSpeed Instrumentation Performance Report

Merging #8171 will not alter performance

Comparing jtran/sketch-ast (d73d0d0) with main (bcb6ed2)

Summary

✅ 89 untouched benchmarks

Base automatically changed from nrc-api-crate to main August 28, 2025 21:26
@jtran jtran force-pushed the jtran/sketch-ast branch from c483bf3 to 5385613 Compare August 29, 2025 01:51
Comment on lines +48 to +55
fn recast_body(
items: &[BodyItem],
non_code_meta: &NonCodeMeta,
inner_attrs: &NodeList<Annotation>,
buf: &mut String,
options: &FormatOptions,
indentation_level: usize,
) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code in this function didn't change semantically. I just factored it out to a function.

@jtran jtran marked this pull request as ready for review August 29, 2025 18:58
@jtran jtran requested review from a team as code owners August 29, 2025 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant