1
0
mirror of https://github.com/danog/liquid.git synced 2024-11-30 08:18:59 +01:00
Commit Graph

342 Commits

Author SHA1 Message Date
nsf
1a2066b87e Properly handle variadic functions.
This commit addresses two issues:

1. For variadic functions 'convertCallArguments' was allocating exactly
   'len(args)' arguments, which might be less than required, as a result
   zero/default filling loop would panic with out of bounds error.

2. Even if we correctly allocate a proper amount of arguments, zero/default
   filling loop doesn't handle special variadic function type case, when last
   argument has a slice type and reflect API expects plain values as arguments.
   But actually we don't need that, because it's okay to omit variadic values
   altogether, hence the total amount of allocated arguments is
   max(len(args), rt.NumIn()-1).
2018-05-30 19:44:29 +05:00
Oliver Steele
e30a0e2788
Travis: add go 1.10; drop 1.8 2018-03-02 11:41:48 -05:00
Oliver Steele
3811e167ab
Remove errant file 2018-03-02 10:51:28 -05:00
Oliver Steele
8874615b3c Match Ruby string split semantics 2017-09-04 17:51:51 -04:00
Oliver Steele
a02d9e12b4 Follow go style guide re declaring empty slices 2017-09-03 12:13:20 -04:00
Oliver Steele
ba2ecf9542 Add go 1.9 to travis build matrix 2017-08-30 09:38:50 -04:00
Oliver Steele
b6c65ffee6 map[unhashable] returns nil instead of panic 2017-08-23 16:03:46 -04:00
Oliver Steele
a50dc106d2 Convert tests 2017-08-23 15:56:27 -04:00
Oliver Steele
d27c839ae3 variable names 2017-08-23 15:56:18 -04:00
Oliver Steele
1a12f12f1d Convert MapSlice -> map 2017-08-21 15:06:35 -04:00
Oliver Steele
bb24f32cbd list filters operate on MapSlice 2017-08-21 10:30:54 -04:00
Oliver Steele
e1c7224d9c variable names 2017-08-21 09:50:29 -04:00
Oliver Steele
cb6efbf216 join filter: default sep is space; omit nil entries 2017-08-20 11:33:58 -04:00
Oliver Steele
5ebf31a84a Default time format is compatible w/ Liquid 2017-08-18 10:43:31 -04:00
Oliver Steele
804e3d6970 Rearrange tests 2017-08-18 10:35:15 -04:00
Oliver Steele
4bc4c8a71b Define IterationKeyedMap 2017-08-15 18:49:29 -04:00
Oliver Steele
c49d979750 Rename rbstrftime package 2017-08-11 11:55:37 -04:00
Oliver Steele
cdb0e44c6f Move strftime to a separate repo 2017-08-10 19:02:13 -04:00
Oliver Steele
6b15fbf6c7 Tests; implement map[nil] 2017-08-09 08:45:48 -04:00
Oliver Steele
fd4d34c403 Nil pointers are equal, even if different types 2017-08-09 08:42:42 -04:00
Oliver Steele
62f44fa728 Rearrange value methods w/in file 2017-08-09 08:16:36 -04:00
Oliver Steele
9852226d22 Restore m['str'] where m map[interface{}]interface{} 2017-08-08 19:31:33 -04:00
Oliver Steele
e39a1fe0d4 Fix array[nil] 2017-08-08 17:15:29 -04:00
Oliver Steele
51d7166e88 Package docs 2017-08-08 16:42:32 -04:00
Oliver Steele
c50491f609 More drop examples 2017-08-08 16:25:23 -04:00
Oliver Steele
0adf6e7411 README: add Appveyor badge 2017-08-08 16:03:24 -04:00
Oliver Steele
068afefea0 Fix file not found tests for Windows 2017-08-08 15:14:31 -04:00
Oliver Steele
1b3e55a488 Appveyor: remove mingw 2017-08-08 14:54:47 -04:00
Oliver Steele
85bd1ddfe1 Replace extern "C" strftime by go implementation 2017-08-08 14:48:10 -04:00
Oliver Steele
8d53a6b4a8 Remove (commented-out) Strptime and tests 2017-08-05 19:36:18 +02:00
Oliver Steele
4a2c4b4b39 Beefy strftime tests 2017-08-05 19:35:38 +02:00
Oliver Steele
83652f59db Actually cache the drop resolution 2017-08-03 15:20:56 +02:00
Oliver Steele
7f501ce512 Race test, benchmarks, for drop resolution 2017-08-03 15:20:56 +02:00
Oliver Steele
eac67c350b Pull loop renderer into separate method
For more readable profiles
2017-08-03 15:20:56 +02:00
Oliver Steele
519fbbeb04 Merge pull request #28 from Proximaio/feature/struct_pointer_member_fix
Fix struct PropertyValue attempting to use an invalid pointer
2017-08-03 09:20:04 -04:00
James Littlejohn
b2f5f1f9ac Fix struct PropertyValue attempting to use an invalid pointer 2017-08-01 11:27:32 +10:00
Oliver Steele
9866cbf5d7 Race condition 2017-07-27 18:30:03 -04:00
Oliver Steele
fb70314da4 Add forwarders from evaluator pkg 2017-07-27 18:28:16 -04:00
Oliver Steele
516182a93c Consolidate {expressions,values}/drops.go 2017-07-27 18:13:39 -04:00
Oliver Steele
6269836192 Move pkg evaluator -> values 2017-07-27 18:11:37 -04:00
Oliver Steele
c17c901385 Merge pull request #26 from Proximaio/feature/customise_delimiters
Add setting to customise delimiters
2017-07-27 18:09:33 -04:00
Oliver Steele
474edc1ca8 remove fmt.Stringer render case 2017-07-26 10:59:35 -04:00
Oliver Steele
a1c59270ea Store original stacktrace in re-thrown errors 2017-07-26 10:12:25 -04:00
Oliver Steele
dd0fcdae87 make lint includes tests 2017-07-26 10:12:25 -04:00
Oliver Steele
fd230ed2cc Tests 2017-07-26 10:12:25 -04:00
Oliver Steele
2353433e66 Merge pull request #27 from Proximaio/feature/variadic_filters
Support registering variadic functions as filters
2017-07-26 10:07:04 -04:00
James Littlejohn
82a1a6ebb1 Support registering variadic functions as filters 2017-07-26 17:06:57 +10:00
James Littlejohn
b7ef67f047 Support delimiters of any length 2017-07-24 12:38:02 +10:00
James Littlejohn
dd4d967eaa Add comments and update tests 2017-07-24 11:00:05 +10:00
Oliver Steele
fd7b1f0875 Treat []byte as string, for some purposes 2017-07-23 11:49:09 -04:00