Fixed FUNCTION x = expression directive

master
Vitaliy Filippov 2018-08-03 00:15:08 +03:00
parent 5f582e684b
commit e8c9cad6f6
4 changed files with 7 additions and 7 deletions

View File

@ -1,7 +1,7 @@
#!/bin/sh
if [ "$LIME_DIR" = "" ]; then
LIME_DIR=~/gits/lime/
LIME_DIR=./lime/
fi
php -d xdebug.max_nesting_level=200 $LIME_DIR/lime.php template.lime | tail -n +2 > template.class

View File

@ -140,7 +140,7 @@ c_fn = fn name/name "(" arglist/args ")" "=" exp/exp {
$this->template->st->functions[$name] = array(
'name' => $name,
'args' => $args,
'body' => 'function fn_'.$name." () {\nreturn ".$exp.";\n}\n",
'body' => 'function fn_'.$name." () {\nreturn ".$exp[0].";\n}\n",
//'line' => $line, Ой, я чо - аргументы не юзаю?
//'pos' => $pos,
);

View File

@ -4,7 +4,7 @@
* Homepage: http://yourcmc.ru/wiki/VMX::Template
* License: GNU GPLv3 or later
* Author: Vitaliy Filippov, 2006-2018
* Version: V3 (LALR), 2018-01-08
* Version: V3 (LALR), 2018-08-03
*
* This file contains the implementation of VMX::Template compiler.
* It is only used when a template is compiled in runtime.
@ -3634,7 +3634,7 @@ class VMXTemplateParser extends lime_parser {
$this->template->st->functions[$name] = array(
'name' => $name,
'args' => $args,
'body' => 'function fn_'.$name." () {\nreturn ".$exp.";\n}\n",
'body' => 'function fn_'.$name." () {\nreturn ".$exp[0].";\n}\n",
//'line' => $line, Ой, я чо - аргументы не юзаю?
//'pos' => $pos,
);
@ -4852,5 +4852,5 @@ class VMXTemplateParser extends lime_parser {
);
}
// Time: 4,2855579853058 seconds
// Memory: 11192016 bytes
// Time: 0.22696185112 seconds
// Memory: 8865560 bytes

View File

@ -8,7 +8,7 @@
* Homepage: http://yourcmc.ru/wiki/VMX::Template
* License: GNU GPLv3 or later
* Author: Vitaliy Filippov, 2006-2018
* Version: V3 (LALR), 2018-01-08
* Version: V3 (LALR), 2018-08-03
*
* The template engine is split into two parts:
* (1) This file - always used when running templates