mirror of
https://github.com/danog/liquid.git
synced 2024-12-02 14:27:46 +01:00
Lint
This commit is contained in:
parent
f15de87195
commit
09d36504b4
@ -42,6 +42,6 @@ const (
|
|||||||
TextChunkType ChunkType = iota
|
TextChunkType ChunkType = iota
|
||||||
// TagChunkType is the type of a tag Chunk "{%…%}"
|
// TagChunkType is the type of a tag Chunk "{%…%}"
|
||||||
TagChunkType
|
TagChunkType
|
||||||
// TextChunkType is the type of an object Chunk "{{…}}"
|
// ObjChunkType is the type of an object Chunk "{{…}}"
|
||||||
ObjChunkType
|
ObjChunkType
|
||||||
)
|
)
|
||||||
|
@ -14,7 +14,7 @@ import (
|
|||||||
// {"{{x}}", "1"},
|
// {"{{x}}", "1"},
|
||||||
// }
|
// }
|
||||||
|
|
||||||
func ScanExpression(data string) ([]yySymType, error) {
|
func scanExpression(data string) ([]yySymType, error) {
|
||||||
l := newLexer([]byte(data))
|
l := newLexer([]byte(data))
|
||||||
var symbols []yySymType
|
var symbols []yySymType
|
||||||
var s yySymType
|
var s yySymType
|
||||||
@ -29,7 +29,7 @@ func ScanExpression(data string) ([]yySymType, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestExpressionScanner(t *testing.T) {
|
func TestExpressionScanner(t *testing.T) {
|
||||||
tokens, err := ScanExpression("abc > 123")
|
tokens, err := scanExpression("abc > 123")
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Len(t, tokens, 3)
|
require.Len(t, tokens, 3)
|
||||||
}
|
}
|
||||||
|
@ -228,9 +228,7 @@ func reverseFilter(in []interface{}) interface{} {
|
|||||||
|
|
||||||
func sortFilter(in []interface{}, key interface{}) []interface{} {
|
func sortFilter(in []interface{}, key interface{}) []interface{} {
|
||||||
out := make([]interface{}, len(in))
|
out := make([]interface{}, len(in))
|
||||||
for i, v := range in {
|
copy(out, in)
|
||||||
out[i] = v
|
|
||||||
}
|
|
||||||
if key == nil {
|
if key == nil {
|
||||||
generics.Sort(out)
|
generics.Sort(out)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user