Commit Graph

35 Commits

Author SHA1 Message Date
Tom Alexander
9eb70f436c Starting a type casting trait 2020-06-13 19:39:31 -04:00
Tom Alexander
d6ad7c28f3 Move MathNumber into the library.
While this will be used for the OwnedLiterals since they must always exhibit the original DustJS behavior, I am going to keep exposing separate math functions for ContextElement instead of simply requiring them to implement Into<MathNumber> since people might want to implement math in unusual ways with unusual types.
2020-06-13 19:13:02 -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
576d94780a Implement a SelectContext for passing the select parameters and whether or not any comparison passed down exactly 1 level in the renderer. 2020-06-07 18:33:34 -04:00
Tom Alexander
d06fbea288 Remove unused code and clean up warnings. 2020-06-07 13:27:57 -04:00
Tom Alexander
e28ebaf26a Update IterationContext to be an IntoContextElement and finish implementing section. 2020-06-06 23:08:21 -04:00
Tom Alexander
ff74d78fdb Starting the new parameters context object. 2020-05-31 21:46:00 -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
15c8e3bf28 Get rid of the CloneIntoBoxedContextElement trait for now because I don't know if its still going to be necessary with this overhaul. 2020-05-31 18:31:49 -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
ff27c2c85d Basic structure for the new tree renderer. 2020-05-31 16:21:13 -04:00
Tom Alexander
3f49519bea Initial structure for new implementation of walking functions using the heterogeneous tree. 2020-05-31 15:44:09 -04:00
Tom Alexander
645b251f13 Initial setup for a heterogenous tree of IntoContextElement. 2020-05-31 13:52:20 -04:00
Tom Alexander
975ab278ef Starting an IntoContextElement trait to allow for delayed evaluation. 2020-05-30 16:34:32 -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
256051220d Generic implementation of CloneIntoBoxedContextElement. 2020-05-10 21:07:31 -04:00
Tom Alexander
8fd2a9cf39 tentatively seems to be working. 2020-05-10 19:16:55 -04:00
Tom Alexander
c96b2257d7 Compiling.
Need to see if I can do a generic implemented of IntoBoxedContextElement for all objects implementing Copy, and I need to implement the compare code to make sure this all works before I start integrating this more.
2020-05-10 19:07:41 -04:00
Tom Alexander
97e806a968 Start of structure for extracting inline partials from a template. 2020-05-09 21:01:37 -04:00
Tom Alexander
bbb9b8d9d3 Partial simple is working. 2020-05-09 14:53:53 -04:00
Tom Alexander
2712126b3c Need to do loop elements. 2020-05-09 14:10:56 -04:00
Tom Alexander
b45448edbd Moved ParametersContext to its own file. 2020-05-08 22:12:35 -04:00
Tom Alexander
e5c4ba8c82 Add a Loopable trait for dust sections. 2020-04-28 19:34:52 -04:00
Tom Alexander
c961cf7ab8 Combine the render traits into a single context_element file. 2020-04-28 19:09:02 -04:00
Tom Alexander
d51392fe8a Initial move to returning results from render calls. 2020-04-12 18:29:40 -04:00
Tom Alexander
5efa650b67 Switching to a combined ContextElement trait for Walkable and Renderable 2020-04-11 22:19:54 -04:00
Tom Alexander
d5c3985c29 initial walkable implementation 2020-04-11 20:31:44 -04:00
Tom Alexander
e26b158ab4 Initial implementation of custom Renderable trait. 2020-04-11 19:11:14 -04:00
Tom Alexander
2459d7b418 Rendering spans 2020-04-11 18:25:48 -04:00
Tom Alexander
13934e8699 Rename DustContext to DustRenderer 2020-04-10 20:58:55 -04:00
Tom Alexander
2842d0a14a Loading the compiled templates into a context 2020-04-10 20:55:44 -04:00
Tom Alexander
743106684a compiling templates in the same manner as the shim 2020-04-10 20:27:27 -04:00