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

*To*: "srfi-110" <srfi-110@xxxxxxxxxxxxxxxxx>*Subject*: Handling scomments after "."*From*: "David A. Wheeler" <dwheeler@xxxxxxxxxxxx>*Date*: Mon, 18 Mar 2013 23:41:32 -0400 (EDT)*Delivered-to*: srfi-110@xxxxxxxxxxxxxxxxx*In-reply-to*: <CAF+kUQWcQJOpPdvST04wy8QiiF+w++KhPFS33F4UPCU85_2r=g@xxxxxxxxxxxxxx>*References*: <CAF+kUQX5mK=VStZyu6zfGQj9SE+J4D=dHPF6+d-T-5a+tZ7XvA@xxxxxxxxxxxxxx> <20130317.154441.695066990312419885.shiro@xxxxxxxx> <CAF+kUQX3ghwPo3Jk95Na0zY3kuxtbLQ-RyzZvthYo7Q-soTXyQ@xxxxxxxxxxxxxx> <E1UHcsS-0001aL-1g@xxxxxxxxxxxxxxxxxxxxx> <CAF+kUQWcQJOpPdvST04wy8QiiF+w++KhPFS33F4UPCU85_2r=g@xxxxxxxxxxxxxx>*Reply-to*: dwheeler@xxxxxxxxxxxx

In the process of fiddling with ". $" I've noticed that the grammar doesn't handle scomments after "." at all. For those just tuning in, "scomments" are special comments (such as #|....|#), and they're normally handled by other conventions in the productions. But after "." is a special situation, and they aren't handled there. So we need to fix that. I've tweaked the BNF grammar to add support for scomments after ".", as noted below. It's getting ugly, especially for "rest"; it might make sense to pull this out as its own separate production just for this case (!). If we do that, we might as well regularize head vs. rest. So the changes below are almost certainly not the last word... just a heads-up that we need to tweak the rules to make them work cleanly. --- David A. Wheeler ============================================== head returns [Object v] : PERIOD /* Leading ".": escape following datum like an n-expression. */ (hspace+ (scomment hspace*)* (pn=n_expr hspace* (scomment hspace)* (n_expr error)? {$v = list($pn.v);} | /*empty*/ {$v = list(".");} ) | /*empty*/ {$v = list(".");} ) ... rest returns [Object v] : PERIOD /* Improper list */ (hspace+ (scomment hspace*)* (pn=n_expr hspace* (scomment hspace+)* (n_expr error)? {$v = $pn.v;} | COLLECTING hspace* pc=collecting_tail hspace* (scomment hspace+)* (n_expr error)? {$v = $pc.v;} | SUBLIST hspace* ps=rest {$v = $ps.v;} | /*empty*/ {$v = list(".");}) | /*empty*/ {$v = list(".");})

**Follow-Ups**:**Re: Handling scomments after "."***From:*David A. Wheeler

**References**:**The ". $" notation (was: Re: how useful are collecting lists?)***From:*Alan Manuel Gloria

**Re: The ". $" notation***From:*Shiro Kawai

**Re: The ". $" notation***From:*Alan Manuel Gloria

**Re: The ". $" notation***From:*David A. Wheeler

**Re: The ". $" notation***From:*Alan Manuel Gloria

- Prev by Date:
**Re: The ". $" notation** - Next by Date:
**Re: Handling scomments after "."** - Previous by thread:
**Re: The ". $" notation** - Next by thread:
**Re: Handling scomments after "."** - Index(es):