Re: eruby delimiters

Shugo Maeda <[email protected]> Sat, 10 Jul 2004 10:59:01 +0900
Newsgroups gmane.comp.apache.mod-ruby
Message-ID <[email protected]>
Hi,

Christian Luginbuehl wrote:
> but still i think the code for the two delimiter-combinations should be 
> the same for both ideas. means: the same piece of code should also for 
> the compile-time option should work for the long <?ruby as well as for 
> the short <%. am i clear?

Is it an implementation matter? I give precedence to the specification.

> thanks for the explanation. i could imagine the analogous escape 
> sequence for <?ruby, namely <?ruby%. but still i did not think alot 
> about that issue because even the idea of escaping ruby-code like that 
> was new to me. at the moment i don't even see the use of that clearly.

I do not remove the escape sequence from the <% style mode.

There are two options.

   1) use <?ruby% or <??ruby for the <?ruby style mode (I prefer the
      second one).
   2) remove the escape sequence from the <?ruby style mode.
      `<?ruby= "<?ruby" ?>' can be used instead.

>> You can eliminate these extra newlines by % at BOL.
>>
>> [ SNIP examples ]
> 
> 
> i always liked the problem of extra newlines coming from nowhere in 
> other languages like JSP, PHP, XSL and not really be able to do a lot 
> against them ;-)

eRuby is not *only* for HTML/XML, it's sometimes used for plain text 
files. Extra newlines are not welcome for them.

But % in BOL is not needed for the <?ruby style mode. Because <?ruby
looks XML specific. This is why I rejected same proposals before.
I think if eruby uses <?ruby, it's better to parse XML (than simple
pattern matching). <?ruby in CDATA should not be handled by eruby,
shouldn't it?

Shugo