Erlang Mailing Lists

Author Message

<  Erlyweb mailing list  ~  How complicated can erltl expressions be?

ketralnis
Posted: Thu Oct 18, 2007 5:10 am Reply with quote
User Joined: 20 Jul 2007 Posts: 151 Location: San Francisco, CA
I'm trying to do the following in an erltl file:

<% case Authenticated of
false -> "";
true -> %>
<tr>
<td colspan="2">
<% do_something() %>
</td>
</tr>
<% end %>

But when I do, I get:

(node@host)14> erlyweb:compile(Appdir,[native,debug_info,
{erlydb_driver,mnesia},{auto_compile,true}]).
debug:erlyweb_compile:364: Compiling ErlTL file "post_view"
** exited: {error,{parse_error,{1,
erl_parse,
["syntax error before: ",["'.'"]]}}} **

Am I doing something wrong, or is that just not supported?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
View user's profile Send private message AIM Address
Guest
Posted: Thu Oct 18, 2007 6:31 am Reply with quote
Guest
In ErlTL, the content between <% and %> must be a complete Erlang
expression, not a fragment thereof. I've thought about supporting the
kind of usage you've shown, but doing so will probably require a
rewrite of the ErlTL compiler. The best of doing this right now is
using a function, e.g.

<%@ row(false) %>
<%@ row(true) %>
<tr>
<td colspan="2">
<% do_something() %>
</td>
</tr>

This has worked well enough for me so far, but I agree that your
approach can make it easier to read the code and figure out which
markup goes where.

Yariv

On 10/17/07, David King <dking@ketralnis.com> wrote:
>
> I'm trying to do the following in an erltl file:
>
> <% case Authenticated of
> false -> "";
> true -> %>
> <tr>
> <td colspan="2">
> <% do_something() %>
> </td>
> </tr>
> <% end %>
>
> But when I do, I get:
>
> (node@host)14> erlyweb:compile(Appdir,[native,debug_info,
> {erlydb_driver,mnesia},{auto_compile,true}]).
> debug:erlyweb_compile:364: Compiling ErlTL file "post_view"
> ** exited: {error,{parse_error,{1,
> erl_parse,
> ["syntax error before: ",["'.'"]]}}} **
>
> Am I doing something wrong, or is that just not supported?
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum