Factor out the parsing of partial template names into its own parser for reuse as an rvalue.

This commit is contained in:
Tom Alexander
2020-05-30 15:45:44 -04:00
parent 4932a4bb6f
commit 3352b777ae
3 changed files with 42 additions and 29 deletions

View File

@@ -11,5 +11,13 @@
{
"petname": "spot"
}
],
"array_petname": [
{
"petname": [
"foo",
"bar"
]
}
]
}

View File

@@ -6,6 +6,22 @@ Hello {name}, nice {pet}{~n}
Hello {name}, nice {pet}{~n}
{/people}
Direct Parameters{~n}
================={~n}
{#people name="chris" pet=petname petname="whiskers"}
Hello {name}, nice {pet}{~n}
{/people}
{#people}
{#truthy name="chris" pet=petname petname="whiskers"}
Hello {name}, nice {pet}{~n}
{/truthy}
{/people}
{#people name="chris" pet=petname petname="whiskers"}
{#other_petname}
Hello {name}, nice {pet}{~n}
{/other_petname}
{/people}
Reference Parameters{~n}
===================={~n}
{#people name="chris" pet="{petname}" petname="whiskers"}
@@ -33,20 +49,3 @@ Reference Parameters{~n}
Hello {name}, nice {pet}{~n}
{/other_petname}
{/people}
Direct Parameters{~n}
================={~n}
{#people name="chris" pet=petname petname="whiskers"}
Hello {name}, nice {pet}{~n}
{/people}
{#people}
{#truthy name="chris" pet=petname petname="whiskers"}
Hello {name}, nice {pet}{~n}
{/truthy}
{/people}
{#people name="chris" pet=petname petname="whiskers"}
{#other_petname}
Hello {name}, nice {pet}{~n}
{/other_petname}
{/people}