test-varlayers.txt

来自「一一个纯JAVA的解析工具,可以做所有可以的事情,而且对本站有非常大的帮助」· 文本 代码 · 共 21 行

TXT
21
字号
<#import "test-varlayers_lib.txt" as lib>
<@foo 1/>
${x} = ${.data_model.x} = ${.globals.x}
<#assign x = 5>
${x} = ${.main.x} = ${.namespace.x}
<#global x = 6>
${.globals.x} but ${.data_model.x} = 4
${y} = ${.globals.y} = ${.data_model.y?default("ERROR")}
Invisiblity test 1.: <#if .main.y?exists || .namespace.y?exists>failed<#else>passed</#if>
Invisiblity test 2.: <#if .main.z?exists || .namespace.z?exists>failed<#else>passed</#if>
Invisiblity test 3.: <#global q = 1><#if .main.q?exists || .namespace.q?exists || .data_model.q?exists>failed<#else>passed</#if>
--
<@lib.foo/>
--
<#macro foo x>
  ${x} = ${.locals.x}
  <#local x = 2>
  ${x} = ${.locals.x}
  <#local y = 3>
  ${y} = ${.locals.y}
</#macro>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?