-
-
Notifications
You must be signed in to change notification settings - Fork 36
Drop separate syntax constructs for markup #371
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
Conversation
This change simplifies parsing a bit, as For clarity, I'm also suggesting here to change our language to say that a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m looking forward to the discussion on Friday about whether open/close are needed in the syntax. Assuming they are, I think this approach is better than our current syntax. That said, I’m still not fond of plus and minus as prefixes. Also, perhaps it would be better to keep the starting :
in all cases? As in, :+strong
for the opening tag.
But why? At least to me |
|
||
expression = ((literal / variable) [s annotation]) | ||
/ annotation | ||
expression = "{" [s] (((literal / variable) [s annotation]) / annotation) [s] "}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my action item I am working on ABNF, but we might as well talk about it here. I was going to suggest:
expression = "{" [s] (((literal / variable) [s annotation])
/ annotation) [s] "}"
annotation = (function / reserved) *(s option)
function = ":" name
reserved = (%21-%26 / %2a / %2b / %2d / %2f
/ %3b-%40 / %5e / %7e) name ; reserved sigil characters, specifically these: !"#$%&*+-/^~
I'm reluctant to embrace +
and -
being "function introducers". I would rather just have a single starter for the "thing we've been calling a function" and having another name for other types of function. If these are different constructs, they should parse to another production name. That can be accommodated by pushing it down a level:
annotation = named *(s option)
named = function / reserved
function = ":" name
reserved = [!@#$%^&*+-<>?] name
This would allow something to become unreserved by adding a named production:
annotation = named *(s option)
named = function / reserved
function = ":" name
fragment = "#" name
reserved = [!@$%^&*+-<>?] name ; deleted # from here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect that ultimately anything that may have an argument and/or a bag of options could be represented by some sort of "function". The proposed shape of reserved
encodes this as the only possible direction for the extension of the spec, so ultimately anything that would be later un-reserved could effectively be described as a "function introducer".
If we don't want to limit ourselves this way, then really the reserved
construct ought to be defined on a higher level, allowing for more freedom (using this PR's syntax as a baseline):
expression = "{" [s] (((literal / variable) [s annotation]) / annotation / reserved) [s] "}"
reserved = reserved-start reserved-body
reserved-start = "!" / "@" / "#" / "$" / "%" / "^" / "&" / "*" / "<" / ">" / "?"
reserved-body = *(reserved-char / reserved-escape / ("{" reserved-body "}") / literal)
reserved-char = %x0-5B ; omit \
/ %x5D-7A ; omit { | }
/ %x7E-D7FF ; omit surrogates
/ %xE000-10FFFF
reserved-escape = backslash ( backslash / "|" / "{" / "}" )
Now, independently of how we might proceed with reserved
, I do think that "open" and "close" placeholders are sufficiently common that they definitely should have their own top-level introducers +
and -
. This leaves us with at least 11 more to use for other concepts, should that prove desirable later on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Merging, as agreed during today's call. |
This is a minimally opinionated extension of our
{$foo :bar opt=42}
placeholder syntax to support markup elements.The idea here is to drop "markup" as an explicit concept in the syntax and to allow for three different function prefix sigils:
:
for standalone content+
for starting or opening elements-
for ending or closing elementsThe exact meaning of these standalone/open/close concepts is left undefined, allowing for each of the following styles to be equivalently expressible: