update deps

This commit is contained in:
Andrey Nering
2017-07-15 13:34:42 -03:00
parent 769e25f080
commit 4ae9c2445d
32 changed files with 466 additions and 20 deletions

View File

@@ -1,3 +1,8 @@
# 1.3.1 (2017-07-10)
## Fixed
- Fixed #57: number comparisons in prerelease sometimes inaccurate
# 1.3.0 (2017-05-02)
## Added

View File

@@ -394,8 +394,29 @@ func comparePrePart(s, o string) int {
return -1
}
if s > o {
// When comparing strings "99" is greater than "103". To handle
// cases like this we need to detect numbers and compare them.
oi, n1 := strconv.ParseInt(o, 10, 64)
si, n2 := strconv.ParseInt(s, 10, 64)
// The case where both are strings compare the strings
if n1 != nil && n2 != nil {
if s > o {
return 1
}
return -1
} else if n1 != nil {
// o is a string and s is a number
return -1
} else if n2 != nil {
// s is a string and o is a number
return 1
}
// Both are numbers
if si > oi {
return 1
}
return -1
}

View File

@@ -623,6 +623,12 @@ func (p *Parser) wordPart() WordPart {
cs.Right = p.matched(cs.Left, leftParen, rightParen)
return cs
case dollar:
r := p.r
if r == utf8.RuneSelf || wordBreak(r) || r == '"' || r == '\'' || r == '`' || r == '[' {
l := p.lit(p.pos, "$")
p.next()
return l
}
p.ensureNoNested()
return p.shortParamExp()
case cmdIn, cmdOut:
@@ -963,9 +969,6 @@ func (p *Parser) shortParamExp() *ParamExp {
p.quote = paramName
p.advanceLitOther(p.r)
p.quote = old
if p.val == "" || p.val == "\x80" {
p.posErr(pe.Dollar, "$ literal must be escaped or single-quoted")
}
}
pe.Param = p.getLit()
return pe