Closed cgray closed 10 years ago
This PR fixes the internal representation of a Quoted String Literal from a strangely quoted string to an instance of \Handlebars\String.
\Handlebars\String
This should move the some of the complexity I previously added to the \Handlbars\Context::get method into \Handlebars\Template::parseArguments
\Handlbars\Context::get
\Handlebars\Template::parseArguments
Template::parseAruments on
Template::parseAruments
{{#ifEquals var "Some Value"}}
Previously would have resulted in
["var", '"Some Value"']
And Context::get treated it as a string literal based on the string staring and ending with a quote.
Context::get
Now parseArguments results in
["var", new \Handlebars\String("Some Value")]
and Context::get treats instances of Handlebars\String as string literals.
Also added a couple of new test cases to test the previously uncovered Template::parseArguments and added to existing test cases.
Template::parseArguments
Thanks @cgray, I like the way that the result of parseArguments can be mapped by Context::get to get exactly what arguments mean.
parseArguments
This PR fixes the internal representation of a Quoted String Literal from a strangely quoted string to an instance of
\Handlebars\String
.This should move the some of the complexity I previously added to the
\Handlbars\Context::get
method into\Handlebars\Template::parseArguments
Template::parseAruments
onPreviously would have resulted in
And
Context::get
treated it as a string literal based on the string staring and ending with a quote.Now parseArguments results in
and Context::get treats instances of Handlebars\String as string literals.
Also added a couple of new test cases to test the previously uncovered
Template::parseArguments
and added to existing test cases.