Merge remote-tracking branch 'prim/master'

Conflicts:
	match_test.go
	queryparser.go
This commit is contained in:
Evan Phoenix
2014-11-05 09:52:03 -08:00
2 changed files with 6 additions and 6 deletions
+3 -4
View File
@@ -2,7 +2,6 @@ package toml
import ( import (
"fmt" "fmt"
"math"
"testing" "testing"
) )
@@ -110,7 +109,7 @@ func TestPathSliceStart(t *testing.T) {
assertPath(t, assertPath(t,
"$[123:]", "$[123:]",
buildPath( buildPath(
newMatchSliceFn(123, math.MaxInt32, 1), newMatchSliceFn(123, MaxInt, 1),
)) ))
} }
@@ -134,7 +133,7 @@ func TestPathSliceStartStep(t *testing.T) {
assertPath(t, assertPath(t,
"$[123::7]", "$[123::7]",
buildPath( buildPath(
newMatchSliceFn(123, math.MaxInt32, 7), newMatchSliceFn(123, MaxInt, 7),
)) ))
} }
@@ -150,7 +149,7 @@ func TestPathSliceStep(t *testing.T) {
assertPath(t, assertPath(t,
"$[::7]", "$[::7]",
buildPath( buildPath(
newMatchSliceFn(0, math.MaxInt32, 7), newMatchSliceFn(0, MaxInt, 7),
)) ))
} }
+3 -2
View File
@@ -9,9 +9,10 @@ package toml
import ( import (
"fmt" "fmt"
"math"
) )
const MaxInt = int(^uint(0) >> 1)
type queryParser struct { type queryParser struct {
flow chan token flow chan token
tokensBuffer []token tokensBuffer []token
@@ -203,7 +204,7 @@ loop: // labeled loop for easy breaking
func (p *queryParser) parseSliceExpr() queryParserStateFn { func (p *queryParser) parseSliceExpr() queryParserStateFn {
// init slice to grab all elements // init slice to grab all elements
start, end, step := 0, math.MaxInt32, 1 start, end, step := 0, MaxInt, 1
// parse optional start // parse optional start
tok := p.getToken() tok := p.getToken()