Closed vdcrea closed 8 years ago
I think the problem here is your PHP version.
Line 378 of the Lexer.php contains yield $token
, so you're probably running a PHP version not supporting yield
yet.
Tale Jade makes heavy use of Generators which improve the overall performance of the lexing and parsing process.
Tale Jade is tested for all versions above PHP5.5 including Hack/HHVM. PHP5.5 is the first version with Generators. https://github.com/Talesoft/tale-jade/blob/master/.travis.yml
Do you have a possibility to upgrade your PHP version to at least 5.5?
Also, for the compilation process you don't need a full renderer, you only need a Tale\Jade\Compiler
$compiler = new Tale\Jade\Compiler(['pretty' => true, ...]);
$xml = $compiler->compile($string);
One word: awesome! Thanks you very much, it works like a charm. Now I will see how it is with Ace editor on the other side, or leave it as a simple textarea. I will let you know when it s done to show you the result.
You may take some impressions from here:
https://github.com/Talesoft/tale-jade-live-compiler/blob/master/scripts/common.coffee Take a look at the whole repository.
The working version can be found here: http://sandbox.jade.talesoft.io
Glad that it works now, have fun with it :)
Extension for Symphony CMS published: http://www.getsymphony.com/download/extensions/view/111595/ Thanks for your help!
Great, I'll add your extension to our README file today :)
Hi, thanks for this huge work. I am trying to integrate tale-jade in a cms extension, the idea is not to convert jade files but directly type jade syntax in a textarea and output xml or xhtml for front end.
But I don't understand how to convert a jade-string (not a jade file), any idea about how to configure? Here is my php:
I tryed other before, but always produce an error:
Parse error: syntax error, unexpected '$token' (T_VARIABLE) in vendor/talesoft/tale-jade/Lexer.php on line 378