[TEMPLO] Switch broken in PHP target

36 views
Skip to first unread message

Jimmy Delas

unread,
Mar 16, 2013, 1:08:39 PM3/16/13
to haxe...@googlegroups.com
Hello,

I tried to put the sample enum from the document defined as

enum QuestItem
{
     ITEM
(id:Int);
     MONEY
(amount:Int);
     XP
(amount:Int);
}

And in my template.mtt file :

::switch myEnum::
   DEFAULT VALUE
::case::
   
Item ::args[0]::
::case::
   
::args[0]:: gold
::case::
   
::args[0]:: XP
::end::


This code compile fine with a command such as

temploc2.exe template.mtt


but it I receive an assert_failure when I try

temploc2.exe -php template.mtt

Here is the log

Called from templo/Main.nml line 183
Called from List.nml line 64
Called from templo/Neko.nml line 467
Called from IO.nml line 100
Exception : (file_open, page.n/tpl__page.mtt.n)

Is there any workaround to use switch ?

Thanks a lot,
Regards

Fabien Antoine

unread,
Mar 18, 2013, 4:03:07 AM3/18/13
to haxe...@googlegroups.com
Hi,

I have a repo for a custom templo which correct some features which were not implemented for PHP like switches, anonymous objects and macros in macros.
I also added a "template comment" syntax : ;; my comment ;; which prevents content to be added to output.
Currently it doesn't work with haxe3 and I should send a pull-request to official repository when I'll have some more time.

Anyway, you can find it here : https://github.com/fantoine/haxe-templo2
The compiled temploc2.n file is here : https://github.com/fantoine/haxe-templo2/tree/master/templo/bin

I hope it helps
--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jimmy Delas

unread,
Mar 18, 2013, 4:40:19 AM3/18/13
to haxe...@googlegroups.com
Nice, I'll check it out ;)

Thanks for your contribution

Regards,
Reply all
Reply to author
Forward
0 new messages