I never said this was expected to be clean, or even easy to do, just that it is 
plausible for the feature set desired. What mucks it up is things that change 
how lexical elements are expected to be recognized; case conditions should use 
someting like <double right angle bracket>, with left angles being optional, to 
indicate end of pattern, not ')', but these don't become part of the base PCS 
until Issue 9.
On Wednesday, April 22, 2020 Joerg Schilling 
<joerg.schill...@fokus.fraunhofer.de> wrote:
shwaresyst <shwares...@aol.com> wrote:

> No, you only lex up to the newline or EOF in the first pass, whether the 
> ending ')' or other context delimeter is found or not, because after the 
> newline may be an io_here body. This is the recognition phase that skips 
> aliases, and the grammar currently has no ambiguities in this regard so it 
> can be lexed. It doesn't even matter if the newline is supposed to be 
> retained in the token because a single quote didn't have it's ending quote 
> yet, the recognition stops there. There probably should be a numbered item 
> about how various keywords establish lexical sub contexts too, but it is 
> accounted for in Item 5 by 'any recursion necessary'.

Did you ever try to write a working shell using lexical parsing for $(...) only?

I did write a working shell based on a clean recursive parsing method and if 
you 
look at: https://www.in-ulm.de/~mascheck/various/cmd-subst/ you'll see that 
bosh/mksh/ksh93 that all use a clean recursive parser are closest to the 
expected behavior. 

Shells that try the lecial only parsing way for $(...), miserably fail.

Jörg

-- 
 EMail:jo...@schily.net                    (home) Jörg Schilling D-13353 Berlin
    joerg.schill...@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/
 URL: http://cdrecord.org/private/ http://sf.net/projects/schilytools/files/'

Reply via email to