On 2/17/21 11:56 AM, Robert Elz wrote:
Chet can explain more if he feels it is warranted, but I believe that even today, bash uses a very heuristic type of almost pretend to be a parser to deal with these things - not really parsing them fully (not until they're to be executed, where the issues all go away, as at that point, nothing else is being parsed) but attempting to handle most cases so things work for real code.
I'd add that the reason I did this back in 2008 was that it was just about impossible to have a re-entrant bison parser (one that calls yyparse() recursively) and completely impossible to do portably with yacc. The situation with bison may have improved. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/