Commit Graph

314 Commits

Author SHA1 Message Date
Tom Alexander
c09393da80
Switch the renderer over to using the new is_truthy value and add the injection of $idx and $len into the context tree. 2020-05-24 16:57:24 -04:00
Tom Alexander
966499db76
Switch the get_loop_elements implementation to only return populated arrays when its an array-like object. 2020-05-24 16:27:13 -04:00
Tom Alexander
59ee4f508f
Add a new trait to ContextElement for Truthiness.
Before I was relying on Loopable to both determine truthiness and get a list of elements to loop over. This will no longer work since I need to only set $idx and $len when iterating over actual arrays, as opposed to all truthy values, so I've finally made truthiness explicit.
2020-05-24 16:16:43 -04:00
Tom Alexander
055d88984e
Implement an injected context for iteration values. 2020-05-24 16:01:56 -04:00
Tom Alexander
e0fe7475c5
Add a single element array test for idx_and_len.
This test is mostly because I am currently turning truthy values into single element arrays during render, so I need to make sure idx and len and not being set for non-array iteration.
2020-05-24 15:29:14 -04:00
Tom Alexander
9925802ae9
Add .$idx to nested section test. 2020-05-24 15:25:17 -04:00
Tom Alexander
93adaa518d
Add a test for $idx and $len inside nested sections. 2020-05-24 15:22:12 -04:00
Tom Alexander
fff401da7e
Add a test to confirm references are getting parsed. 2020-05-24 15:22:12 -04:00
Tom Alexander
abf251c68d
Add a test for $idx and $len. 2020-05-24 15:22:10 -04:00
Tom Alexander
381ed43645
Merge branch 'combined_walk_path' into render 2020-05-24 15:21:53 -04:00
Tom Alexander
39c579171b
Rename the new functions to replace the old functions. 2020-05-24 15:21:30 -04:00
Tom Alexander
46fe1f5204
Fix the last case by changing the lifetimes and delete the old fractured implementation. 2020-05-24 15:20:36 -04:00
Tom Alexander
4790ac77d6
Initial implementation combining owned_walk_path and walk_path. Works everywhere except one spot. 2020-05-24 14:56:09 -04:00
Tom Alexander
a58b605e59
Add support for dot paths to owned_walk_path. 2020-05-24 14:17:53 -04:00
Tom Alexander
1ad9753845
Add an ignored test for type casting.
I think in order to support type casting in a generic fashion so that custom non-json types can be used, I'll need to push the implementation of helpers off into the traits instead of handling it in the renderer. This is a larger undertaking than I was planning on starting at this very moment, so I'm going to leave this test disabled and move on to a couple smaller tasks I wanted to knock out before starting implementation on custom helpers.
2020-05-24 13:05:34 -04:00
Tom Alexander
6c89f7c59a
Merge branch 'literal_string_block' into render 2020-05-23 23:47:32 -04:00
Tom Alexander
b73561caf9
Add support for literal string blocks. 2020-05-23 23:46:46 -04:00
Tom Alexander
533ea96d4f
Add a test for literal string blocks. 2020-05-23 23:32:13 -04:00
Tom Alexander
c3360907ee
Merge branch 'dot_leading_path' into render 2020-05-23 23:26:33 -04:00
Tom Alexander
50079c6415
Add support in the renderer for handling paths containing dot. 2020-05-23 23:26:00 -04:00
Tom Alexander
95dc15f103
Update parser to preserve the dot and support paths beginning with a dot. 2020-05-23 23:12:51 -04:00
Tom Alexander
6e8c7621f1
It seems paths with a leading dot restrict the scope the below the current context. 2020-05-23 23:06:04 -04:00
Tom Alexander
da4ef1a8c8
Remove the headers to the dust helper tests because they were misleading. 2020-05-23 22:41:12 -04:00
Tom Alexander
f16c3a4fa1
Merge branch 'filters' into render 2020-05-23 22:39:13 -04:00
Tom Alexander
92b9e571be
Array had the same javascript escaping string issue.
Filed a bug at https://github.com/linkedin/dustjs/issues/802 .
2020-05-23 22:37:56 -04:00
Tom Alexander
5424543122
Object also should not turn into a string during javascript escape. 2020-05-23 22:31:33 -04:00
Tom Alexander
96e8dd63a7
Dustjs appears to have an output limit of 65536 characters which was breaking the string test, so I split it in two. 2020-05-23 22:23:54 -04:00
Tom Alexander
7ff1f310f5
Same issue with numbers. 2020-05-23 22:06:25 -04:00
Tom Alexander
71378ed37d
Fix a bug w.r.t. quoting and escaping boolean values with filters. 2020-05-23 19:34:38 -04:00
Tom Alexander
bd7866e973
Implement encodeURIComponent filter. 2020-05-23 19:10:02 -04:00
Tom Alexander
46d4f50410
Implement the encodeURI filter. 2020-05-23 19:06:09 -04:00
Tom Alexander
8d2728a767
Implement javascript string escaping. 2020-05-23 18:40:09 -04:00
Tom Alexander
f3fef17d4b
I was wrong, html escape filter is appended even if an html escape filter is already there. 2020-05-23 18:18:59 -04:00
Tom Alexander
e22bffd2ba
Implemented the json stringify and parse filters. 2020-05-23 18:14:23 -04:00
Tom Alexander
624c83b680
Automatically appending the html escape filter on the renderer side. 2020-05-23 17:57:19 -04:00
Tom Alexander
6a9fe9e1be
Beginning of applying filters for json types. Currently only supports html escaping. 2020-05-23 17:23:48 -04:00
Tom Alexander
34c8d24a69
Adding to the manual array test. 2020-05-23 16:07:24 -04:00
Tom Alexander
894da51916
Adding a manually written filters test for more specific testing.
The generated one is more for brute forcing compliance.
2020-05-23 16:04:36 -04:00
Tom Alexander
c81a0c5001
Add tests for the other json types. 2020-05-23 15:58:12 -04:00
Tom Alexander
a0136ea62e
Add a generated test invoking all the filters except jp. 2020-05-23 15:52:31 -04:00
Tom Alexander
a6641d9c72
Add a template to dump the parameters to a custom helper. 2020-05-23 14:28:21 -04:00
Tom Alexander
9892d2f61d
Merge branch 'dynamic_partials' into render 2020-05-17 21:21:52 -04:00
Tom Alexander
5ddeeac966
minor cleanup. 2020-05-17 21:21:26 -04:00
Tom Alexander
93f9581d8a
Renamed the new partial implementation to the old partial name. 2020-05-17 21:17:34 -04:00
Tom Alexander
7be00ffea6
Remove the old partial implementation. 2020-05-17 21:15:03 -04:00
Tom Alexander
ecf2576a0a
Remove default case from render_tag. 2020-05-17 21:12:27 -04:00
Tom Alexander
10c8b25817
Implement the new partial type in the renderer. 2020-05-17 21:11:55 -04:00
Tom Alexander
402d8679e2
Switch the parser over to a new partial implementation for dynamic partials. 2020-05-17 20:44:17 -04:00
Tom Alexander
52ba4fd0a3
Only run each command once in the compliance test suite. 2020-05-17 16:40:23 -04:00
Tom Alexander
a33b46661e
Add a script to run a single test to make development easier since I often want to focus on one test at a time. 2020-05-17 16:32:16 -04:00