Commit Graph

238 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
fff401da7e
Add a test to confirm references are getting parsed. 2020-05-24 15:22:12 -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
b73561caf9
Add support for literal string blocks. 2020-05-23 23:46:46 -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
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
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
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
4645530473
Use the render function when doing string coercion for json values. 2020-05-17 15:52:38 -04:00
Tom Alexander
756fdb7d00
Tests are once again passing. 2020-05-17 00:40:55 -04:00
Tom Alexander
830bb06a92
Unifying number comparison. 2020-05-17 00:27:21 -04:00
Tom Alexander
731f235d9e
fix greater than. 2020-05-16 23:26:33 -04:00
Tom Alexander
03a8328148
Fix the equality test. 2020-05-16 23:19:02 -04:00
Tom Alexander
d77ab7401c
Switched over to using operators instead of compare in the renderer. 2020-05-16 23:10:04 -04:00
Tom Alexander
596611c03a
Mostly implemented the new comparison logic for json with new literals. 2020-05-16 23:07:05 -04:00
Tom Alexander
189dfb1755
Fix tests. 2020-05-16 22:39:29 -04:00
Tom Alexander
c905e705ff
Transition to new literals compiling.
Tests still need work, as does the implementation for json.
2020-05-16 22:31:40 -04:00
Tom Alexander
bc25c1ee16
Starting to remove the old RValues. 2020-05-16 22:19:51 -04:00
Tom Alexander
16d8891452
Implement partial_compare for OwnedLiteral. 2020-05-16 22:08:03 -04:00
Tom Alexander
bf35fd0ae4
equals implementation for literal. 2020-05-16 22:02:58 -04:00
Tom Alexander
6519add838
Starting an OwnedLiteral type instead of using rust's built-in primitives. 2020-05-16 21:52:44 -04:00
Tom Alexander
dd160c5708
Hitting an infinite loop on compare string and int. 2020-05-16 21:34:45 -04:00
Tom Alexander
054480b797
First stab at fixing the error, not a full success. 2020-05-16 21:30:51 -04:00
Tom Alexander
ce8b73f87a
Implement less than or equals. 2020-05-16 19:06:40 -04:00
Tom Alexander
30b7324049
Implement less-than. 2020-05-16 19:05:03 -04:00
Tom Alexander
496a5e0ac7
Had to manually interpret the partial_cmp output instead of using the built-in operators since gte confusingly returns true for mismatched values. 2020-05-16 18:36:47 -04:00
Tom Alexander
62cd73f9c9
Initial attempt at implementation, tests not working. 2020-05-16 18:28:23 -04:00
Tom Alexander
f640cb0440
Fixed greater than helper by using rust's PartialOrd implementation for Vec. 2020-05-16 18:16:07 -04:00
Tom Alexander
b53a9e1837
Cleaning up and factoring out reused code in the renderer. 2020-05-16 17:17:43 -04:00