So, I'd like to recommend a special case for '$(', as implemented in
the patch at the bottom of this message.
I'm sure there's a better way to ignore '$' in these cases. In fact,
it may be more appropriate to have a list of characters to include
rather than a list of characters to exclude.
What do you think? Should I just suck it up and continue to use "\$"
in all my jQuery code?
Thanks
-lee
--- sgte-0.4.1.orig/src/sgte_parse.erl 2007-05-18 12:57:01.100403416
-0500
+++ sgte-0.4.1/src/sgte_parse.erl 2007-05-18 13:12:36.922136888
-0500
@@ -149,6 +149,8 @@
parse(Rest1, [{ift, ParsedIf, Line}|Parsed], Line)
end
end;
+parse([H,H1|T], Parsed, Line) when H == $$ andalso H1 == $( ->
+ parse(T, [H1,H|Parsed], Line);
parse([H|T], Parsed, Line) when H == $$ andalso hd(T) == $$ ->
parse(tl(T), [H|Parsed], Line);
parse([H|T], Parsed, Line) when H == $$ ->
In the trunk I've added options to control some aspects of the
rendering. I could add a 'prototype_jquery_suopport' option to handle
these cases.
What do you think of this solution?
filippo
There also shouldn't be the need for 'nonatom_character_support'. BTW
something like '(\'someId\')' is a valid erlang atom :-).
I've made the changes in the trunk. It seems to work. Let me know if you
have problems.
cheers,
filippo
Lee Teague wrote:
> To be honest, I don't like having special cases, either, I just wanted
> to bring this up for discussion.
>
> Rather than a 'prototype_jquery_support' option, how about a
> 'nonatom_character_support', then change the default behaviour to only
> support keywords that look like a valid erlang atom ([a-z])?
>
> -lee
>
>
> On 5/19/07, *Filippo Pacini* <filippo...@gmail.com
> lte...@dashf.com <mailto:lte...@dashf.com>