Skip to content

Simple number literal parsing#77

Merged
kylef merged 1 commit intostencilproject:masterfrom
djbe:feature/number-literal
Dec 7, 2016
Merged

Simple number literal parsing#77
kylef merged 1 commit intostencilproject:masterfrom
djbe:feature/number-literal

Conversation

@djbe
Copy link
Copy Markdown
Contributor

@djbe djbe commented Dec 7, 2016

I hit this when trying to do the following:

{% if items.count > 1 %}

Which doesn't work, because the rhs Variable evaluates to nil. This simply adds a number literal parser to allow this expression to work.

Small note: I'm purposefully not using a NumberFormatter to parse the number, because I want to ignore the user's locale for things like the decimal separator. Luckily enough, this simple way of parsing a number evaluates stuff like 2two and three3 to nil, so it really only parses actual numbers.

Copy link
Copy Markdown
Collaborator

@AliSoftware AliSoftware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kylef
Copy link
Copy Markdown
Collaborator

kylef commented Dec 7, 2016

Great! I'm 👍 on the change, I just want to get to the bottom of #76 because this adds another use of Float80.

@kylef kylef merged commit 2d507e7 into stencilproject:master Dec 7, 2016
@djbe djbe deleted the feature/number-literal branch December 7, 2016 19:43
@djbe djbe mentioned this pull request Dec 7, 2016
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants