abstractml icon indicating copy to clipboard operation
abstractml copied to clipboard

New Grammar

Open ntrupin opened this issue 5 years ago • 4 comments

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

ntrupin avatar Nov 18 '19 13:11 ntrupin

I'm leaving this pull request open for a bit to promote discussion on the new format.

ntrupin avatar Nov 18 '19 13:11 ntrupin

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.

Yamboy1 avatar Nov 18 '19 18:11 Yamboy1

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.

ntrupin avatar Nov 18 '19 19:11 ntrupin

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)

Yamboy1 avatar Nov 19 '19 00:11 Yamboy1