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