[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Very minor grammar tweak



I intend to include a very minor grammar tweak.

Previously "(GROUP_SPLIT | scomment) EOL DEDENT" was illegal because
there was no way to return an "empty" value.
Oh, wait, we can do that now!  So we may as well allow it.
That would permit, for example:
a b c
!   d e
!   #| this scomment is the last child line |#
=> (a b c (d e))

This removes one token from the grammar, and a few lines
from the implementation.  Here's the grammar change:

 group_line returns [Object v]
   : (GROUP_SPLIT | scomment) hs /* Initial; Interpet as group */
       (group_i=it_expr {$group_i} /* Ignore initial GROUP/scomment */
        | comment_eol
          (INDENT g_body=body {$g_body} /* Normal GROUP use */
-          | same {empty_tag} )) ;
+          | {empty_tag} )) ;


Comments?


--- David A. Wheeler