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

*To*: "srfi-110" <srfi-110@xxxxxxxxxxxxxxxxx>*Subject*: Re: Handling scomments after "."*From*: "David A. Wheeler" <dwheeler@xxxxxxxxxxxx>*Date*: Tue, 19 Mar 2013 00:12:38 -0400 (EDT)*Delivered-to*: srfi-110@xxxxxxxxxxxxxxxxx*In-reply-to*: <E1UHnQa-0005fI-GU@xxxxxxxxxxxxxxxxxxxxx>*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> <E1UHnQa-0005fI-GU@xxxxxxxxxxxxxxxxxxxxx>*Reply-to*: dwheeler@xxxxxxxxxxxx

Here's an updated BNF to deal with scomments after period. I've ended up adding a whole new production rule to deal with it. This makes "head" and "rest" consistent, it simplifies the other rules, and it'll also make the Scheme implementation easier too. We need to do this whether or not we allow the ". $" sequence; we can remove "SUBLIST" from the post_period production if we want to remove that. Comments? Any errors here? If this seems okay, I'll change the Scheme implementation to match, but I'd rather have the BNF right in the first place :-). (The BNF below is in Java syntax; when it goes into the SRFI it'll get changed to Scheme syntax.) --- David A. Wheeler ============================================== // Process line after ". hspace+" sequence. Does not go past current line. post_period returns [Object v] : (scomment hspace*)* // NOTE: The SUBLIST and empty branch (alternatives 3 and 4) are // technically ambiguous (SUBLIST is first, so it's resolved first). (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(".");} ) ; head returns [Object v] : PERIOD /* Leading ".": escape following datum like an n-expression. */ (hspace+ pp=post_period {$v = list($pp.v);} | /*empty*/ {$v = list(".");} ) ... rest returns [Object v] : PERIOD /* Improper list */ (hspace+ pp=post_period {$v = $pp.v;} | /*empty*/ {$v = list(".");}) | scomment hspace* (sr=rest {$v = $sr.v;} | /*empty*/ {$v = null;} ) ...

**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

**Handling scomments after "."***From:*David A. Wheeler

- Prev by Date:
**Handling scomments after "."** - Next by Date:
**Re: The ". $" notation** - Previous by thread:
**Handling scomments after "."** - Next by thread:
**Re: The ". $" notation (was: Re: how useful are collecting lists?)** - Index(es):