1
0
mirror of https://github.com/danog/liquid.git synced 2024-11-30 06:08:57 +01:00
This commit is contained in:
Oliver Steele 2017-06-29 13:14:47 -04:00
parent f15de87195
commit 09d36504b4
3 changed files with 4 additions and 6 deletions

View File

@ -42,6 +42,6 @@ const (
TextChunkType ChunkType = iota
// TagChunkType is the type of a tag Chunk "{%…%}"
TagChunkType
// TextChunkType is the type of an object Chunk "{{…}}"
// ObjChunkType is the type of an object Chunk "{{…}}"
ObjChunkType
)

View File

@ -14,7 +14,7 @@ import (
// {"{{x}}", "1"},
// }
func ScanExpression(data string) ([]yySymType, error) {
func scanExpression(data string) ([]yySymType, error) {
l := newLexer([]byte(data))
var symbols []yySymType
var s yySymType
@ -29,7 +29,7 @@ func ScanExpression(data string) ([]yySymType, error) {
}
func TestExpressionScanner(t *testing.T) {
tokens, err := ScanExpression("abc > 123")
tokens, err := scanExpression("abc > 123")
require.NoError(t, err)
require.Len(t, tokens, 3)
}

View File

@ -228,9 +228,7 @@ func reverseFilter(in []interface{}) interface{} {
func sortFilter(in []interface{}, key interface{}) []interface{} {
out := make([]interface{}, len(in))
for i, v := range in {
out[i] = v
}
copy(out, in)
if key == nil {
generics.Sort(out)
} else {