Tom Alexander
a622a7e1bc
Add an is_castable() function to stop casting to number for booleans in the @size helper.
4 years ago
Tom Alexander
d47e004084
Implement logic in comparison helpers to perform type casting. Casting to non-number not yet implemented.
4 years ago
Tom Alexander
5dff03bb37
Add a test case for type casting to the equality helper tests.
4 years ago
Tom Alexander
92c65a109b
Implement the contextDump helper.
4 years ago
Tom Alexander
648ae5dfdb
Turns out I was wrong, the @size helper attempts to cast to a number regardless of the input and it uses that. Fixed the test.
4 years ago
Tom Alexander
716a110d2e
Added some notes about observed behavior and fixed return types for missing/absent keys.
4 years ago
Tom Alexander
44d54c86d2
Implement the size helper but it has a bug somewhere.
4 years ago
Tom Alexander
76193bf806
Stubs for the size and contextDump helpers.
4 years ago
Tom Alexander
c5a0ad6786
Wire up the math functions to the renderer.
4 years ago
Tom Alexander
2c5c2d239c
Add a special case to not render anything if the method parameter to the math helper is a template to match the official DustJS implementation.
4 years ago
Tom Alexander
d9f10290f5
Math helper nearly done, test almost passes.
4 years ago
Tom Alexander
28a4fea96f
Remove RValue from ParametersContext so I can re-use it for calculated values from math.
4 years ago
Tom Alexander
e6c17fb603
Bodiless math is now working in the simple cases.
4 years ago
Tom Alexander
9eb70f436c
Starting a type casting trait
4 years ago
Tom Alexander
11096d7ece
Bodiless math implementation.
4 years ago
Tom Alexander
8daa746da6
Initial structure for the perform_math_operation function.
4 years ago
Tom Alexander
6877e3d393
Add parser support for the math helper.
4 years ago
Tom Alexander
a937a12db6
Cleanup.
4 years ago
Tom Alexander
88887bff0f
Implemented early termination.
4 years ago
Tom Alexander
0fac063c8d
Implemented none and any, but I need to implement early termination.
4 years ago
Tom Alexander
f1b868ce33
I think I have the code for the select tag finished, but I haven't yet implemented any or none.
4 years ago
Tom Alexander
b0b857147d
Implemented code to find out if any comparison checks inside a select are true.
4 years ago
Tom Alexander
ed38ce6a38
Unified the renderers for all the comparison helpers by moving their implementation to perform_comparison_check.
4 years ago
Tom Alexander
85d36fc516
Implemented perform_comparison_check to separate the comparison logic from the render code so that it can be used pre-rendering by the select helper.
4 years ago
Tom Alexander
f2740987ec
Add a parent to ParametersContext so we can chain parameters contexts for use with the select helper.
4 years ago
Tom Alexander
a61807d84c
Add parser support for select/any/none.
4 years ago
Tom Alexander
a749f91e8e
Ported over the comparison helpers to using the new tap function.
4 years ago
Tom Alexander
78dad3273a
Remove $len from first helper since its not needed.
4 years ago
Tom Alexander
417466d17d
Implement the first and last helpers.
4 years ago
Tom Alexander
fdecdcb53b
Implemented the sep helper.
4 years ago
Tom Alexander
3fb91566bb
Implement get and tap functions.
4 years ago
Tom Alexander
d06fbea288
Remove unused code and clean up warnings.
4 years ago
Tom Alexander
4e1259f1c7
All tests working.
4 years ago
Tom Alexander
b1a85165b0
All tests passing!
4 years ago
Tom Alexander
4789a7d931
Fix the same issue in the renderer.
4 years ago
Tom Alexander
422479bcf2
port over the remaining helpers.
4 years ago
Tom Alexander
8cbb31251c
port over the equals/not equals helpers.
4 years ago
Tom Alexander
c8de395038
Inline partials and blocks worked as-is.
4 years ago
Tom Alexander
250d428464
Updated Partial for the new architecture.
4 years ago
Tom Alexander
b396765488
Updated Exists/NotExists for the new architecture.
4 years ago
Tom Alexander
e28ebaf26a
Update IterationContext to be an IntoContextElement and finish implementing section.
4 years ago
Tom Alexander
00699b84ba
Finished converting back to Vec.
4 years ago
Tom Alexander
b0efe50410
Fixed new_breadcrumbs_section for the Vec based breadcrumbs.
4 years ago
Tom Alexander
71592a9a32
Switching back to a Vec because inserting multiple elements into the linked list structure while maintaining ownership of each node proved to be difficult.
4 years ago
Tom Alexander
78bffb5f04
I think I need to switch back to a vec.
...
But with all I've built with IntoContextElement and BreadcrumbTreeElement I think the Vec will end up working in the end.
4 years ago
Tom Alexander
77b842f8de
Implement IntoContextElement for ParametersContext.
4 years ago
Tom Alexander
02259b9bd6
Create from_borrowed and from_owned constructors for IceResult and BreadcrumbTreeElement.
...
In an effort to keep track of how often memory is getting heap allocated, I am implementing constructors for IceResult and BreadcrumbTreeElement. This should limit the places that I call Rc::new and allow me to place tracing code into it later to ensure all code paths doing heap allocation make sense.
4 years ago
Tom Alexander
f9dea70d23
Implement conversion from IceResult into BreadcrumbTreeNode.
...
I believe this change will remove an extra heap allocation I was doing in the new_breadcrumbs_* functions for the explicit context by adding support for converting from Rc<dyn ContextElement> to Rc<dyn IntoContextElement> without copying the underlying data. This should allow conversion of the IceResult::Owned variant to the BreadcrumbTreeElement::Owned variant without extra copying.
4 years ago
Tom Alexander
c5b927ca11
Fix bug in use of breadcrumbs in new_breadcrumbs_partial.
4 years ago
Tom Alexander
e725728a65
I think I have solved the lifetime issue.
...
OwnedBreadcrumbTreeElement's needed a lifetime associated with them because IntoContextElement had lifetimes associated with it.
4 years ago