Skip to content

Commit

Permalink
resolves 99designs#92: fix processing of negative scalars during pars…
Browse files Browse the repository at this point in the history
…e literals
  • Loading branch information
shnellpavel authored and neelance committed May 30, 2017
1 parent 2c50321 commit d30eb00
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/common/literals.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,12 @@ func ParseLiteral(l *Lexer, constOnly bool) Literal {
}
lit.Loc = loc
return lit

case '-':
l.ConsumeToken('-')
lit := l.ConsumeLiteral()
lit.Text = "-" + lit.Text
lit.Loc = loc
return lit
case '[':
l.ConsumeToken('[')
var list []Literal
Expand Down

0 comments on commit d30eb00

Please sign in to comment.