Commit Graph

200 Commits

Author SHA1 Message Date
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
283430a45b
Merge the breadcrumb tree trait and struct into just a struct. 2020-05-31 18:14:26 -04:00
Tom Alexander
439601bbb5
First I'll try to eliminate the duplication between the BreadcrumbTree and BreadcrumbTreeNode. 2020-05-31 18:05:49 -04:00
Tom Alexander
1111b48270
Due to traits I am going to have to start hard-replacing the old renderer file. 2020-05-31 18:02:02 -04:00
Tom Alexander
de5914417e
All but explicit context for new_breadcrumbs_section. 2020-05-31 17:56:07 -04:00
Tom Alexander
b381789422
Slight progress on new_breadcrumbs_section. 2020-05-31 17:32:06 -04:00
Tom Alexander
2b532e7eb4
Going to try switching to boxed owned values to remove the template. 2020-05-31 17:25:41 -04:00
Tom Alexander
92dca74505
Running into issue where I need to know the type to create new tree node elements. 2020-05-31 16:40:39 -04:00
Tom Alexander
ff27c2c85d
Basic structure for the new tree renderer. 2020-05-31 16:21:13 -04:00
Tom Alexander
65445cc8fc
Finished implementing the new tree walking. 2020-05-31 16:16:21 -04:00
Tom Alexander
863744c42d
Got rid of the IceTreeIterator by using map(). 2020-05-31 16:02:30 -04:00
Tom Alexander
781b8f645a
Switch IntoIter over to the breadcrumb iterator. 2020-05-31 15:58:29 -04:00
Tom Alexander
ff13d22ab6
Renamed BreadcrumbTreeIterator to IceTreeIterator. 2020-05-31 15:52:46 -04:00
Tom Alexander
89c751e849
I think I need to implement iterating on the tree nodes. 2020-05-31 15:51:18 -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
456da98bed
Added an iter function which I think will let me automatically make iterators without having to explicitly take a reference to the tree. 2020-05-31 14:29:59 -04:00
Tom Alexander
bebedf56e4
Implement IntoIterator for references to a BreadcrumbTreeNode. 2020-05-31 14:27:31 -04:00
Tom Alexander
1be60511ed
Implement an iterator over the tree. 2020-05-31 14:17:21 -04:00
Tom Alexander
645b251f13
Initial setup for a heterogenous tree of IntoContextElement. 2020-05-31 13:52:20 -04:00
Tom Alexander
a578b57f12
Switch the call for IntoContextElement back to a static integer so it compiles again. 2020-05-31 13:21:47 -04:00
Tom Alexander
21b9e9282b
Ran into issue: Can't returned owned data when its expecting a trait object. 2020-05-30 18:28:33 -04:00
Tom Alexander
737c98d8b7
Add the renderer to calls to convert to a context element. 2020-05-30 18:16:58 -04:00
Tom Alexander
917da5a073
Put IntoContextElement everywhere. It compiles again. 2020-05-30 17:50:27 -04:00
Tom Alexander
975ab278ef
Starting an IntoContextElement trait to allow for delayed evaluation. 2020-05-30 16:34:32 -04:00
Tom Alexander
0236f882b7
Delete the old new_breadcrumbs function that is no longer used. 2020-05-30 14:45:48 -04:00
Tom Alexander
add77cf6a5
Get rid of the concept of NamedBlock and replace it with a ParameterizedBlock special case that does not support an else block. 2020-05-30 14:39:31 -04:00
Tom Alexander
a0e2ba2b82
Had to update the 1-behind insertion for partial parameters to account for pseudo elements. 2020-05-30 12:24:50 -04:00
Tom Alexander
3c9a369908
Skipping over pseudo contexts has fixed most of the tests. 2020-05-30 11:50:55 -04:00
Tom Alexander
f04e84dc31
Attempted to move section over to the section-specific new breadcrumbs function.
I think the problem is, the index context needs to be a higher priority than the new context element, but when referencing data with `{.}` the new context element needs to take priority. I could either combine entries in the context tree so that variables like $idx and $len live side-by-side with real context elements, or try to implement a way to skip over index context elements when walking up the tree.
2020-05-25 23:28:49 -04:00
Tom Alexander
79f52ecdee
Add test for priorities while looping and split the new_breadcrumbs function into two separate new_breadcrumbs functions because sections and partials have different orderings. 2020-05-25 22:50:10 -04:00
Tom Alexander
c78695d08e
Remove a TODO. 2020-05-25 19:34:36 -04:00
Tom Alexander
25eb9b10a0
I did it backwards, I needed to use the explicit context from the block, not the inline partial. 2020-05-25 19:24:49 -04:00
Tom Alexander
6845df7f96
First attempt at an implementation of the new breadcrumbs for blocks/inline partials. 2020-05-25 19:11:14 -04:00
Tom Alexander
83623897af
Integrate new_breadcrumbs into the helpers. 2020-05-25 18:27:54 -04:00
Tom Alexander
400602124e
Added tests proving that the explicit context is evaluated using the global context of the partial containing the block (NOT the inline partial, which is where the explicit context is written). 2020-05-25 17:53:04 -04:00
Tom Alexander
d02c98cb94
Add a special case to new_breadcrumbs for when theres an injected context but no explicit context or new context element and finish the partial integration. 2020-05-25 16:30:15 -04:00
Tom Alexander
17121aa85b
Integrated new_breadcrumbs into exists and not exists, and partially integrated it into partials. 2020-05-25 16:03:00 -04:00
Tom Alexander
32c047a9b9
Integrate the new_breadcrumbs function into sections. 2020-05-25 15:55:52 -04:00
Tom Alexander
d79447e602
Update the new_breadcrumbs function to return an Option to prevent needlessly cloning the breadcrumbs when no new contexts are to be added. 2020-05-25 15:49:30 -04:00
Tom Alexander
4a21ae5af3
Add tests for explicit context setting that check failure conditions and implement a helper function to generate a new breadcrumb stack. 2020-05-25 15:40:42 -04:00
Tom Alexander
8121c93392
Make the dust template parser all_consuming. 2020-05-25 14:17:38 -04:00
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
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