Commit Graph

77 Commits

Author SHA1 Message Date
Tom Alexander
d9ce011113
Add implementation based on MathNumber. 2020-06-13 19:02:56 -04:00
Tom Alexander
df0ae05648
Start of implementation for serde_json but I'm going to change my approach.
The permutations are pretty intense, so I think I'm going to do the same design I did for comparison where I have a JsonNumber (but I'll call this one MathNumber and rename JsonNumber to ComparisonNumber), convert the types to that, and then do the math.
2020-06-13 18:34:13 -04:00
Tom Alexander
db11677b22
Implement addition for OwnedLiterals. 2020-06-13 17:50:22 -04:00
Tom Alexander
8ef3949a65
Fix float json to literal equality comparison by casting them both to float. 2020-06-13 16:32:57 -04:00
Tom Alexander
d99aa44d8e
Add support for negative integers. 2020-06-13 16:06:31 -04:00
Tom Alexander
02bcefb75c
Remove outdated TODO. 2020-06-13 15:33:21 -04:00
Tom Alexander
03ff75b2de
Fix number comparison logic. 2020-06-13 15:31:52 -04:00
Tom Alexander
4d28120732
I have broken the comparison function. 2020-06-13 14:55:27 -04:00
Tom Alexander
5b656a44ad
For partial_cmp, convert OwnedLiterals into serde_json values. 2020-06-13 14:19:03 -04:00
Tom Alexander
a378d6e6f3
Add comparisons for json floats but not yet between OwnedLiterals and json. 2020-06-13 13:47:43 -04:00
Tom Alexander
d06fbea288
Remove unused code and clean up warnings. 2020-06-07 13:27:57 -04:00
Tom Alexander
669a698575
Re-enable the ContextElement implementation for serde_json 2020-06-07 00:17:55 -04:00
Tom Alexander
6bde22b667
Re-enabled compiling templates from bin.rs. 2020-05-31 19:08:10 -04:00
Tom Alexander
f1ec0ffb9e
Got rid of most of the Clone traits on the parser types since some of the parser results now contain owned values rather than just references. 2020-05-31 19:01:51 -04:00
Tom Alexander
b8b4759d45
Remove iteration_context, parameters_context, and most of bin.rs.
Since I'm changing a pretty core concept of the renderer, I'm going to be rebuilding it piece by piece. In the interest of being able to rapidly change things and check if they are valid through compilation, I need to eliminate most of the old code so I do not have that weighing me down.
2020-05-31 18:27:55 -04:00
Tom Alexander
acb8dfb58e
Replaced the old renderer file with a new renderer file. 2020-05-31 18:18:21 -04:00
Tom Alexander
917da5a073
Put IntoContextElement everywhere. It compiles again. 2020-05-30 17:50:27 -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
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
e22bffd2ba
Implemented the json stringify and parse filters. 2020-05-23 18:14:23 -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
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
596611c03a
Mostly implemented the new comparison logic for json with new literals. 2020-05-16 23:07:05 -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
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
f640cb0440
Fixed greater than helper by using rust's PartialOrd implementation for Vec. 2020-05-16 18:16:07 -04:00
Tom Alexander
7d4cb14530
Add that check to the not-equals helper and update the json value implementation to mark all non-scalars as not-equals. 2020-05-16 15:30:17 -04:00
Tom Alexander
6dbeb77a28
Add arrays to all helpers tests. 2020-05-16 14:19:56 -04:00
Tom Alexander
2b5bec05be
Implemented partial_compare for scalar json values. 2020-05-16 14:08:59 -04:00
Tom Alexander
563fd1f6db
Starting comparison of json value to json value. 2020-05-16 13:44:34 -04:00
Tom Alexander
9851a2556d
Ordering implementation for comparison between json and literals. 2020-05-16 13:40:56 -04:00
Tom Alexander
8748cb7063
Structure for ordering, need to implement for serde_json::Value. 2020-05-16 13:31:52 -04:00
Tom Alexander
9ee8f41022
Implement the render send of integer literals. 2020-05-10 23:11:16 -04:00
Tom Alexander
7dd824ab4f
cleaning up. 2020-05-10 22:40:47 -04:00
Tom Alexander
46bb5558ac
Going to a more generic equality comparison for json. 2020-05-10 22:26:47 -04:00
Tom Alexander
6261f7881c
Manual equals is working! 2020-05-10 22:14:07 -04:00
Tom Alexander
9baa669dea
Separating out CastToAny. 2020-05-10 22:04:41 -04:00
Tom Alexander
32abe41e1a
Generic implementation of CompareContextElement. 2020-05-10 21:11:49 -04:00