Skip to content

Commit

Permalink
resolves #92: fix processing of negative scalars during parse literals
Browse files Browse the repository at this point in the history
  • Loading branch information
shnellpavel authored and neelance committed May 30, 2017
1 parent 48c1a0f commit fddcbcb
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 fddcbcb

Please sign in to comment.