From: Robert Feldt Date: 2001-10-25T09:11:44+09:00 Subject: [ruby-talk:23242] Re: Parsing Ruby's interpolated strings/regexps On Thu, 25 Oct 2001, Yukihiro Matsumoto wrote: > Hi, > Hi and thanks for your prompt reply, > In message "[ruby-talk:23237] Parsing Ruby's interpolated strings/regexps" > on 01/10/25, Robert Feldt writes: > > |and then recursively parses the Evstr "b+1" when in evaluation of the > |program with the regexp. > > For the first time only. Evstr stores its parse tree. > > |But if you have a separate parser (ie. not bound to a special > |interpreter) would you expect the "b+1" string to > |have been parsed in the Abstract Syntax Tree you get back? > > If you have reentrant parser, yes. But unfortunately yacc does not > allow it. > Aha, so its a workaround. I thought you decided to do it that way for some "philosophical" reason. Thanks, this is much clearer then. BTW, I know you often have good reasons for your decisions but out of curiosity: What is the reason for allowing %!str! etc type strings (ie. the interpolated once without brace/paren delimiters). IMHO, this is rarely used and doesn't add much (more than complexity in lexer). /Robert