Tom Alexander
7087157ed3
Add partial test for walking up context vs parameters
2020-05-07 19:28:22 -04:00
Tom Alexander
0fcb70927c
Add an initial test of partial parameters
2020-05-07 19:12:45 -04:00
Tom Alexander
467a810569
Merge branch 'exists' into render
2020-05-06 20:33:02 -04:00
Tom Alexander
dedfa79630
Do a truthiness check on references before printing them.
2020-05-06 20:30:03 -04:00
Tom Alexander
b45688351e
Rendering a reference appears to do a truthiness check because false renders an empty string despite rendering as "false" in an array element.
2020-05-06 20:13:33 -04:00
Tom Alexander
0f47000a9b
Add support for the exists tag.
2020-05-06 19:10:09 -04:00
Tom Alexander
35f1ba8447
Merge branch 'walk_up_context' into render
2020-05-05 20:47:58 -04:00
Tom Alexander
3cf47fa1a8
Rename the new functions to replace the old functions.
2020-05-05 20:46:31 -04:00
Tom Alexander
18f9fb7f57
Delete old render functions.
2020-05-05 20:43:53 -04:00
Tom Alexander
05527377c4
Finish porting over the walk test.
2020-05-05 20:38:42 -04:00
Tom Alexander
9c414d4d06
Fixed rendering else blocks.
2020-05-05 20:32:30 -04:00
Tom Alexander
5760566be0
Start of porting over the walk tests.
2020-05-05 20:22:25 -04:00
Tom Alexander
26fe996b0d
Implement the new render functions.
2020-05-05 19:51:07 -04:00
Tom Alexander
a3bb8e47c1
Implemented the backtracing logic for walking.
2020-05-04 23:45:21 -04:00
Tom Alexander
6bcc66dff5
Adding NotFound error type.
2020-05-04 23:36:13 -04:00
Tom Alexander
033fc9de6b
Implement walking for a single segment,
2020-05-04 23:10:35 -04:00
Tom Alexander
c3fe7b47af
Added a test for backtracking.
...
DustJS appears to not do any backtracking.
2020-05-03 16:49:34 -04:00
Tom Alexander
2b6c3990a9
Add test for a multi-step walk into a parent context.
...
This test proves that the dynamic scoping does not add the intermediate steps when doing a multi-step walk.
2020-05-03 16:32:29 -04:00
Tom Alexander
45facfed0d
Improve the walk up test to prove that DustJS is doing dynamic scoping, not lexical scoping.
2020-05-03 16:13:29 -04:00
Tom Alexander
9adb88d132
Added a test case for walking up the context
2020-05-03 15:47:21 -04:00
Tom Alexander
e957caf386
Render the else block in sections if the path does not exist or if the path can't be walked.
...
This fixes all existing compliance tests.
2020-05-03 15:29:02 -04:00
Tom Alexander
cc6dbefcdb
Implement specials in the renderer.
2020-05-03 14:52:08 -04:00
Tom Alexander
7f65e73229
Merge branch 'bug_tags_separated_by_whitespace' into render
2020-05-03 14:46:12 -04:00
Tom Alexander
bafff8e7a0
Finished transitioning to the new top-level ignored whitespace template element.
2020-05-03 14:44:09 -04:00
Tom Alexander
908ae078b0
Start of making ignored whitespace a top-level template element to handle it in a more generic fashion.
2020-05-03 13:43:49 -04:00
Tom Alexander
b8c59f012b
Expanded the test definition and fixed part of the problem.
2020-05-03 13:21:02 -04:00
Tom Alexander
7670db9259
Identified an issue where tags separated by only whitespace are breaking parsing.
2020-05-03 13:07:27 -04:00
Tom Alexander
f97bb25ca8
Integrated the new span class
2020-05-03 12:48:02 -04:00
Tom Alexander
b8e8f19724
Implemented a new span to trim leading whitespace.
...
Through my experiements I have concluded that DustJS trims whitespace at the front of a line. To handle this, I implement a new parser that matches a newline followed by any amount of whitespace. This should allow me to trim whitespace at the head of the line because spans start immediately after a tag is closed. So, for example:
```
{foo}
bar
{/foo}
```
Would be:
```
{foo}\n bar{/foo}
^ ^
\____/
span
```
So while there is no magical "start of line" detector like in regular expressions, the first start of a line in a span will always be preceded with a newline character except for the opening of the document. For handling the opening of the document I am already trimming the whitespace in the `template()` parser.
2020-05-03 12:28:55 -04:00
Tom Alexander
31029bf50b
Add a test for whitespace inside the template.
...
This is similar to the surrounding whitespace test but for whitespace inside of a tag as opposed to before/after the first element of the template.
2020-05-02 19:30:23 -04:00
Tom Alexander
82fb4964ee
Merge branch 'trait_wrapper' into render
2020-05-02 17:23:29 -04:00
Tom Alexander
9a261aa870
Fixed lifetime issue
2020-05-02 16:08:39 -04:00
Tom Alexander
7b87e30ff9
Fixed returns but hitting lifetime issue
2020-05-02 16:04:10 -04:00
Tom Alexander
caa79d5ba2
Moving towards a generic trait wrapper to call between dynamic and static dispatch functions.
2020-05-02 15:55:38 -04:00
Tom Alexander
3cfc294e93
Add an array-context test case for the sections test
2020-04-28 20:47:26 -04:00
Tom Alexander
f0a69d12b9
First attempt at a section render function.
...
Running into an issue with generics vs dynamic references.
2020-04-28 20:46:29 -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
41ad6179d1
Parse self-references and add a test for sections.
2020-04-28 19:02:43 -04:00
Tom Alexander
71181fbd9a
Add a test case for comments
2020-04-12 22:10:16 -04:00
Tom Alexander
8e4f5e3229
Fixing warnings
2020-04-12 21:57:42 -04:00
Tom Alexander
883bda7a78
Added the signature for passing filters into the render function.
...
Added the signature for passing filters into the render function but I am not yet using the filters.
2020-04-12 21:54:15 -04:00
Tom Alexander
70cb107f86
Removing unused imports
2020-04-12 21:44:38 -04:00
Tom Alexander
d813a66610
Add test for booleans and null
2020-04-12 21:42:08 -04:00
Tom Alexander
7a28e6a9d4
Handle rendering json arrays and objects
2020-04-12 21:40:34 -04:00
Tom Alexander
24d2c1831c
Handle missing references
2020-04-12 21:26:23 -04:00
Tom Alexander
fe32edbc28
Update gitignore for compliance tests
2020-04-12 21:19:28 -04:00
Tom Alexander
0c4e97c556
typo
2020-04-12 21:14:21 -04:00
Tom Alexander
cc52c3ad05
Merge branch 'render_result' into render
2020-04-12 21:09:17 -04:00
Tom Alexander
610adc8b72
Switch the Renderable trait over to the returning a RenderError
2020-04-12 21:09:03 -04:00