Closed
Description
I'm refactoring our BNF in #344 to explicitly define whitespace rules. In order to do so, I had to change our grammar from LL(1) to LL(1) with backtracking.
In the process I noticed an opportunity to make the grammar LL(2). IIUC, this provides more guarantees about the complexity of parsing than LL(1) with backtracking. LL(2) is still O(n), while backtracking can be arbitrarily long and can result in exponential worst-case complexity.
-Placeholder ::= '{' s? (Expression | Markup | MarkupEnd)? s? '}'
+Placeholder ::= '{' s? (Expression | Markup | MarkupEnd) s? '}'
Do we need empty placeholders?
I recall previous discussions with @eemeli about potentially allowing comment-only or metadata-only placeholders in the future. Any thoughts on this?
Originally posted by @stasm in #344 (comment)