On Thu, Jan 08, 2015 at 02:43:27PM -0700, Jeff Law wrote:
> >A section that describes the lexical structure and syntax of .md files?
> Seems reasonable. However, is that too heavyweight?
> 
> ISTM we have, effectively 3 items.
> 
> Directives that start with an open-paren and end with their associated 
> close paren.  ANything in between those parens is governed by the 
> documentation for the specific directive.
> 
> Outside a directive we can lines with are empty or contain just 
> whitespace.  These lines are effectively ignored.
> 
> Also outside a directive are lines that start with ';;'. From the ';;' 
> to the end of line are comments and ignored.

Empty lines are whitespace.  Comments are whitespace (two kinds of
comments: ";comment<EOL/EOF>" (single semi-colon!), as well as C-style
/*comments*/).

At the top level, you have <optional whitespace> '(' <opt ws> <name>
<whatever that kind of thing wants> <opt ws> ')'; repeat; <opt ws>.

<whatever> is constrained by just a few things: anything starting with
'"' is parsed as a string (i.e. until a non-quoted second '"'); everything
starting with '{' is parsed as a C block (i.e. until a matching '}'),
and outside of those the parens have to match.

Oh, and <name> can contain much more than just alphanumerics, but we
really shouldn't document that ;-)


Segher

Reply via email to