Skip to content
Discussion options

You must be logged in to vote

Practically, my gut feeling is that a grammar won’t be very useful for djot (or in general for light markup languages). The structure is much more shallow (few distinct syntactic constructs), any input should have a parse tree, and there are a bunch of 2D rules (indentation, block quotes). So I’d probably recommend doing what djot.JS implementation does (parse blocks using sort-of-recusive descent maintaining a stack of blocks, witching each block parse inlines maintaining a map of potential openners).

Theoretically, I think djot isn’t LL(k) (because of attributes and rules for emphasis), but it might be LR or PEG.

But I need to extend djot's syntax to support more features

Could you te…

Replies: 1 comment 20 replies

Comment options

You must be logged in to vote
20 replies
@bpj
Comment options

@xxxserxxx
Comment options

@dereuromark
Comment options

@jgm
Comment options

jgm Jul 8, 2026
Maintainer

@dereuromark
Comment options

Answer selected by shi-yan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
7 participants