Browse Source

bugfixes, typos

Roberto Saccon 17 years ago
parent
commit
d101044fba

+ 2 - 2
demo/out/test_extend.html

@@ -1,4 +1,4 @@
-bar2string
+bar1string
 
 
 base template
 base template
 
 
@@ -6,6 +6,6 @@ replacing the base title
 
 
 more of base template
 more of base template
 
 
-replacing the base content - variable: bar1string after variable 
+replacing the base content - variable: bar2string after variable 
 
 
 end of base template
 end of base template

+ 1 - 1
demo/out/test_variable.html

@@ -5,7 +5,7 @@
     <title>Test variable</title>								 
     <title>Test variable</title>								 
   </head>
   </head>
   <body>
   <body>
-	foostring
 	bar
 	bar
+	foostring
   </body>
   </body>
 </html>
 </html>

+ 0 - 0
demo/templates/test_extend.html → demo/templates/test_extends.html


+ 3 - 3
src/demo/erlydtl_demo.erl

@@ -86,12 +86,12 @@ compile(Name, Ext) ->
 %%--------------------------------------------------------------------
 %%--------------------------------------------------------------------
 render() ->
 render() ->
     render("variable", ".html", ["foostring", "bar"]),
     render("variable", ".html", ["foostring", "bar"]),
-    render("extend", ".html", ["bar1string", "bar2string"]),
+    render("extends", ".html", ["bar1string", "bar2string"]),
     render("comment", ".html"),
     render("comment", ".html"),
     render("simple", ".html"),
     render("simple", ".html"),
     render("htmltags", ".html"),
     render("htmltags", ".html"),
     render("csstags", ".css"),
     render("csstags", ".css"),
-    render("for", ".html"). %, ["apple", "banana"]).
+    render(Name, ".html", [["apple", "banana"]]).
         
         
 
 
 %%--------------------------------------------------------------------
 %%--------------------------------------------------------------------
@@ -102,7 +102,7 @@ render() ->
 render("variable" = Name) ->
 render("variable" = Name) ->
     render(Name, ".html", ["foostring", "bar"]);
     render(Name, ".html", ["foostring", "bar"]);
  
  
-render("extend" = Name) ->
+render("extends" = Name) ->
     render(Name, ".html", ["bar1string", "bar2string"]);
     render(Name, ".html", ["bar1string", "bar2string"]);
         
         
 render("comment" = Name) ->
 render("comment" = Name) ->

+ 1 - 2
src/erlydtl/erlydtl_server.erl

@@ -199,7 +199,7 @@ compile([H | T], ModuleName, FunctionName, RelDir, Ext) ->
 			{List0, Arg0}
 			{List0, Arg0}
 	end, 
 	end, 
 	List1 = erl_syntax:list(List),
 	List1 = erl_syntax:list(List),
-	Args1 = [erl_syntax:variable(Val) || {Val, _} <- Args],
+	Args1 = [erl_syntax:variable(Val) || {Val, _} <- lists:reverse(Args)],
 	Clause = erl_syntax:clause(Args1, none, [List1]),
 	Clause = erl_syntax:clause(Args1, none, [List1]),
 	Func = erl_syntax:function(erl_syntax:atom(FunctionName), [Clause]),
 	Func = erl_syntax:function(erl_syntax:atom(FunctionName), [Clause]),
 	[Mod, Cmp] = [erl_syntax:attribute(erl_syntax:atom(X), [erl_syntax:atom(Y)]) ||
 	[Mod, Cmp] = [erl_syntax:attribute(erl_syntax:atom(X), [erl_syntax:atom(Y)]) ||
@@ -268,7 +268,6 @@ build_tree([H | T], [{var, Line, Var}], Out, Args, DocRoot, Ext, Var) ->
     build_tree(H, T, [erl_syntax:variable(Var) | Out], Args, DocRoot, Ext, Var) ;
     build_tree(H, T, [erl_syntax:variable(Var) | Out], Args, DocRoot, Ext, Var) ;
     		
     		
 build_tree([H | T], [{var, Line, Val}], Out, Args, DocRoot, Ext, IgnoreVar) ->
 build_tree([H | T], [{var, Line, Val}], Out, Args, DocRoot, Ext, IgnoreVar) ->
-    io:format("TRACE ~p:~p 111 ~p~n",[?MODULE, ?LINE, {Val, IgnoreVar}]),   % {"fruit",fruit}
     case lists:keysearch(Val, 2, Args) of
     case lists:keysearch(Val, 2, Args) of
         false ->           
         false ->           
             Key = list_to_atom(lists:concat(["A", length(Args) + 1])),
             Key = list_to_atom(lists:concat(["A", length(Args) + 1])),