-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Update leaf syntax to leaf 4 #3794
Conversation
Thanks, but it looks like this whole grammar is super old and using very old conventions - we have nicer ways to do a lot of this now. I'll try to pull this down and make a pass at cleaning it up then toss it back. Is there a list of official helpers/keywords in Leaf (loop, for, etc)? If so we should build them in so they can be highlighted as |
https://docs.vapor.codes/leaf/overview is basically all you have to work off of. Anyone can define any tag though, so it doesn't really make sense to distinguish between built-in and user defined. The only built in tag that has any different syntax from an arbitrarily user defined one is |
Sounds good to me. We've been living without syntax highlighting on those specific keywords for a couple of years now so I don't know if there are any strong opinions lol |
I updated the expected markup to match what we want to generate. There's only one thing missing, which is tag functions can nest inside each other (nested functions omit the |
Give me a few actual examples please. |
Sorry, I put it in the markup test. It's basically something like: |
Regex doesn't support infinite nesting, but the parser does... for something like one rule immediately inside another we have a shortcut "self"... for less-direct looping you have to create the objects separate then link them together as the grammar is executed. IE:
Where a contains b which contains c, etc... but there is nothing to stop |
Hey, it works! LGTM |
- exact credit is now accurately shown via https://github.com/highlightjs/highlight.js/graphs/contributors
@joshgoebel Is there something remaining to be done here holding up merging? |
Yeah, just need to update the changelog :) |
Done |
Thanks! |
Changes
Overhauled the leaf syntax to match the new leaf 4 grammar
https://docs.vapor.codes/leaf/overview
Checklist
CHANGES.md