I am working on a project where I generate code / scripts (specifically Perl scripts) through Java and Freemarker. I am working at the moment, but wondered if there is a way to change the default variable separator ($) in Freemarker?
Or is there another Java template engine that will use a variable separator more suitable for creating a Perl script?
It can be assumed that such a function will be in the same place as the ability to choose between the angle bracket syntax and the square bracket syntax.
http://freemarker.org/docs/api/freemarker/template/Configuration.html
.
, : , .
$foo, ${foo}.
perl, - $, :
$${foo} -> $FOO <#noparse>${</#noparse>${foo}} -> ${FOO}
: -)
, - , perl , escape/noescape.
FTL.jj ${ } (a FM_EXPRESSION), , .
${
}
FM_EXPRESSION
%{x} FTL ${x} , Perl :
%{x}
${x}
% perl -spi.bak -e "s/\\$/\<#noparse\>\\$\<\/#noparse\>/g,s/\%\{/\\$\{/g" file
:
%{var}=${value}
${var}=<#noparse>$</#noparse>{value}
Source: https://habr.com/ru/post/1743997/More articles:Kohana 3 - get ORM verification errors - phpDrupal's session table is getting huge - drupalWhy can't I pass the form field of a type file to CFFUNCTION using structure syntax? - coldfusionC ++ Any way to store different templates in one container - c ++ERROR: Failed to contact SSO server - biztalkСообщения об ошибках gcc - gccBest way to find kids module? - ruby | fooobar.comsingle sign-on using coldfusion with IIS version 5 using NTLM - coldfusionIs there a free open source (GNU GPL, LGPL, etc.) Comet Video Chat? (PHP) - phphow to convert RSAParameters from .net to .pem file so that I can use it in php - c #All Articles