Skip to content
This repository has been archived by the owner on Jan 26, 2019. It is now read-only.

Refactor of Quoted Literal String Handling and More tests #37

Merged
merged 3 commits into from
Jan 20, 2014

Conversation

cgray
Copy link
Contributor

@cgray cgray commented Jan 20, 2014

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 on

{{#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.

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.

…stance of \Handlebars\String instead of strangely quoted string.
…rals from strangely quoted string to an instance of \Handlebars\String
everplays added a commit that referenced this pull request Jan 20, 2014
Refactor of Quoted Literal String Handling and More tests
@everplays everplays merged commit 21b3bf9 into XaminProject:master Jan 20, 2014
@everplays
Copy link
Contributor

Thanks @cgray, I like the way that the result of parseArguments can be mapped by Context::get to get exactly what arguments mean.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants