Skip to content
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

feat: implement JSX ... notation #54

Merged
merged 8 commits into from
Apr 28, 2024

Conversation

eric-wieser
Copy link
Member

@eric-wieser eric-wieser commented Apr 24, 2024

This makes <tag {...atts}>{...children}</tag> work, and adds support in the delaborator.

The delaborator prints <tag foo={1} {...attrs}><child />{...children}</tag> in a suboptimal way, but it's better than it was before.

@eric-wieser eric-wieser marked this pull request as ready for review April 27, 2024 11:19
Copy link
Collaborator

@Vtec234 Vtec234 left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

/-- Interpolates an expression into a JSX literal -/
scoped syntax "{" term "}" : jsxChild
scoped syntax jsxElement : jsxChild

scoped syntax:max jsxElement : term

def transformTag (n m : Ident) (ns : Array Ident) (vs : Array (TSyntax `jsxAttrVal))
/-- Sends `#[a, b, c]` to `` `(term| $a ++ $b ++ $c)``-/
def joinArrays {m} [Monad m] [MonadRef m] [MonadQuotation m] (arr : Array Term) : m Term := do
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we move the general functions such as joinArrays/foldInlsM/delabListLiteral/... to a ProofWidgets.Util module?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've moved the new ones in this PR.

@Vtec234 Vtec234 merged commit 292b339 into leanprover-community:main Apr 28, 2024
2 checks passed
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.

None yet

2 participants