From: "Jon A. Lambert" Date: 2005-04-27T06:26:32+09:00 Subject: Re: Is Ruby grammar context free? Peter Suk wrote: > Something like this runs under Ruby 1.8. I believe this construction > is not context free, if the language requires heredoc beginning and > ending delimiters to be paired. (Which Ruby seems to. It throws a > syntax error if I leave out the second foo.) Note that you can nest > the beginning of the heredoc arbitrarily. I just noticed it also breaks operator continuation. Assuming your myfunc returned a string.. This is a syntax error. myfunc(<<"THIS", 23, <<'THAT') + "moo" Here's a line or two. THIS and here's another. THAT This is okay. myfunc(<<"THIS", 23, <<'THAT') + "moo" Here's a line or two. THIS and here's another. THAT