[Parsetree] ruby_parser w/ rails?

Sven Fuchs svenfuchs at artweb-design.de
Tue Feb 12 15:53:06 PST 2008


Hi Marcin,

thanks for the reply!

Am 07.02.2008 um 19:03 schrieb Marcin Raczkowski:
> anyway please try greping for class decalrations in each library and  
> try
> to find conflicts

I tried this, but with no success. Maybe I just have to wait until  
RubyParser becomes more mature?

I switched to ParseTree for now. If I get things right, ParseTree and  
RubyParser both use UnifiedRuby so the resulting syntax trees should  
be the same?

FYI, I believe I've got some basic concept working for a Haml safemode  
that parses the Ruby code and prepends a method to_jail in front of  
each :call or :fcall node. Thus, something like: article.title would  
become to_jail.article.to_jail.title. The method to_jail follows the  
same concept as to_liquid for Liquid. It returns a Rails blankslate- 
like objects from which all but certain methods have been removed.  
This way it seems to be easy to control what methods can be called  
from within a Haml tempate.

I've put the intermediary results online here: http://svn.artweb-design.de/stuff/rails/haml_safemode/ 
  Haml/Rails integration is still pretty coarse, e.g. one can't use  
any helpers etc. yet.

If anyone cares, I'd greatly appreciate further input on this!



--
sven fuchs			svenfuchs at artweb-design.de
artweb design		http://www.artweb-design.de
grünberger 65		+ 49 (0) 30 - 47 98 69 96 (phone)
d-10245 berlin		+ 49 (0) 171 - 35 20 38 4 (mobile)





More information about the Parsetree mailing list