if..else if construct not parsed correctly
define editEntity( e : Entity ){ if ( e isa NewsItem) { "do something" } else if(e isa Profile){ "do something" } }
gives “Template with signature else() not defined” and ambiguous fragment on template:
Submitted by Elmer van Chastelet on 13 January 2014 at 14:43- Fragment is ambiguous: amb([Define([],"editEntity",[Arg("e",SimpleSort("Entity"))],None, [IfElseIfTempl(IsA(Var("e"),SimpleSort("NewsItem")),[TemplateCallNoBody("edit",[Cast(Var("e"),SimpleSort("NewsItem"))])], [ElseIfTempl(IsA(Var("e"),SimpleSort("Profile")),[Text("")])],None)]),Define([],"editEntity",[Arg("e",SimpleSort("Entity"))],None, [IfNoElseTempl(IsA(Var("e"),SimpleSort("NewsItem")),[TemplateCallNoBody("edit", [Cast(Var("e"),SimpleSort("NewsItem"))])]),TemplateCallNoArgs("else"),IfNoElseTempl(IsA(Var("e"),SimpleSort("Profile")), [Text("")])])])
Issue Log
On 13 January 2014 at 15:24 Elmer van Chastelet commented:
Fixed in https://svn.strategoxt.org/websvn/WebDSL/?op=revision&rev=5867&peg=5867
On 13 January 2014 at 15:24 Elmer van Chastelet closed this issue.
Log in to post comments