abstractml
abstractml copied to clipboard
New Grammar
Description
Rewrote the compile to use a new, more intuitive grammar.
Type of change
Please delete options that are not relevant.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [x] This change requires a documentation update
Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
I'm leaving this pull request open for a bit to promote discussion on the new format.
Just my opinion, I'm not a big fan of using a slash as a line terminator. I feel like a \n
should be good enough there. Also with the div, I would prefer syntax such as
div:
p > Element here
using whitespace and indents to show where the div starts and stops. Also, note the colon, so you can see where the nested element starts.
I think I’ll work on implementing the colon, but I’m not sure about removing the line terminator. I think it’s important to have a symbol to indicate the end of a tag, and HTML does already use /
in the closing tag, so I feel like it fits.
I think it’s important to have a symbol to indicate the end of a tag,
Considering that you say in the readme that only a single tag is allowed on each line, it would make more sense that the newline becomes the terminator.
My only other thing is that the /
is a weird character to use at the end of the line/tag, it feels like it should continue the line on (like it does in javascript strings)