For completeness, here's the current (and trivial) "body" production.  Comments 
welcome, though I can't imagine what they'd be.

This production collects child lines of a parent line until it sees the 
concluding dedent.  It's only triggered when there are child lines at all 
(i_expr doesn't call body unless there's an "indent").  Practically all the 
real work is done by its recursing back to i_expr.

The "same" non-terminal doesn't really do anything, it's just a reminder that 
each child has to have the same indentation (which must, by definition, be 
longer than its parents').

 --- David A. Wheeler


================================================

// "body" handles the sequence of 1+ child lines in an i_expr
// (e.g., after a "head"), each of which is itself an i_expr.
// It returns the list of expressions in the body.
// Note that an i-expr will consume any line comments or hspaces
// before it returns back to the "body" production.
// Non-tokenizing implementation notes:
// Note that i_expr will consume any line comments (line comments after
// content, as well as lines that just contain indents and comments).
// Note also that i-expr may set the the current indent to a different value
// than the indent used on entry to body; the latest indent is compared by
// the special terminals DEDENT and BADDENT.

body returns [Object v] : i_expr
  (same body1=body {$v = cons($i_expr.v, $body1.v);}
   | dedent        {$v = list($i_expr.v);} ) ;


------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
Readable-discuss mailing list
Readable-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/readable-discuss

Reply via email to