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

Commit

Permalink
zclsyntax: properly scan the modulo operator
Browse files Browse the repository at this point in the history
Previously we missed the '%' character in our "SelfToken" production,
which meant that the modulo operator could not parse properly due to it
being represented as a TokenInvalid.
  • Loading branch information
apparentlymart committed Mar 3, 2018
1 parent 386ab32 commit 440debc
Show file tree
Hide file tree
Showing 4 changed files with 296 additions and 247 deletions.
12 changes: 12 additions & 0 deletions hcl/hclsyntax/expression_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ func TestExpressionParseAndValue(t *testing.T) {
cty.NumberIntVal(5),
0,
},
{
`2*5+1`,
nil,
cty.NumberIntVal(11),
0,
},
{
`9%8`,
nil,
cty.NumberIntVal(1),
0,
},
{
`(2+unk)`,
&hcl.EvalContext{
Expand Down
Loading

0 comments on commit 440debc

Please sign in to comment.