@top Document { heading line* } heading { Heading? "\n" } line { Indent* ((AutoLink | word) space*)* "\n" } @tokens { space { $[ \t] } word { ![ \t\n]+ } Heading { ![\n]+ } Indent { space } AutoLink { ("http" | "https") "://" word } @precedence { AutoLink, word } }