89 Commits (0302ed216f166b32f2891602ecb2c853abb28e73)

Author SHA1 Message Date
Tom Alexander 0302ed216f
Add my implementation of a take_until_parser_matches parser.
The author of nom is too busy to review the PR, and cargo does not allow for git dependencies, so I am going to copy my implementation into this code base so I can use upstream nom so I can push to cargo. While this code has been submitted upstream to nom which is under the MIT license, I am the author of this code so I believe I have the full right to also release it in this project under the 0BSD license.
3 years ago
Tom Alexander a9a83d1b4a
Update for the latest nom and make serde an optional dep. 3 years ago
Tom Alexander 83c86ff9b3
Move ComparisonNumber into the library and add an OwnedLiteral for booleans. 4 years ago
Tom Alexander 69fa266692
Allow spaces before closing braces on tags without parameters.
Previously I incorrectly only supported spaces before closing braces on tags with parameters. This patch expands that behavior to all tags.
4 years ago
Tom Alexander 76193bf806
Stubs for the size and contextDump helpers. 4 years ago
Tom Alexander de5932b4c6
Fix bug in parsing order for literals. 4 years ago
Tom Alexander 2a89fd826e
Update tests to use templates instead of literal strings for string parameters. 4 years ago
Tom Alexander d99aa44d8e
Add support for negative integers. 4 years ago
Tom Alexander 978bbe6eb3
Implemented float literals for OwnedLiterals, not yet for serde_json. 4 years ago
Tom Alexander 6877e3d393
Add parser support for the math helper. 4 years ago
Tom Alexander a61807d84c
Add parser support for select/any/none. 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 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. 4 years ago
Tom Alexander 975ab278ef
Starting an IntoContextElement trait to allow for delayed evaluation. 4 years ago
Tom Alexander 581f9f7e97
Update parser to treat all string rvalues as templates. 4 years ago
Tom Alexander 3352b777ae
Factor out the parsing of partial template names into its own parser for reuse as an rvalue. 4 years ago
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. 4 years ago
Tom Alexander 108cffb771
Fully replaced conditional's Container type with ParameterizedBlock. 4 years ago
Tom Alexander dc92973313
Switch parameterized blocks to having a Path for a name and taking a parser for a name matcher in the goal of merging with the conditional blocks. 4 years ago
Tom Alexander 2527baeff4
Pull the calls for the DustTag constructor up out of parameterized_block. 4 years ago
Tom Alexander 8121c93392
Make the dust template parser all_consuming. 4 years ago
Tom Alexander 5b2ac7c2c2
Add parser support for explicit contexts in helpers. 4 years ago
Tom Alexander 12de0245c5
Implemented parser support for explicit contexts in partials. 4 years ago
Tom Alexander 9031108d2a
Implemented parsing for explicit contexts in NamedBlocks. 4 years ago
Tom Alexander dbee569931
Finish adding explicit context to the parser for Container. 4 years ago
Tom Alexander 1152ff9974
Greatly expand the explicit_context_setting test.
Turns out explicit context setting works in a lot more places than the official dustjs pages indicate. Also some things don't make much sense (like setting it on a block works but not on an inline partial).
4 years ago
Tom Alexander fff401da7e
Add a test to confirm references are getting parsed. 4 years ago
Tom Alexander b73561caf9
Add support for literal string blocks. 4 years ago
Tom Alexander 95dc15f103
Update parser to preserve the dot and support paths beginning with a dot. 4 years ago
Tom Alexander 5ddeeac966
minor cleanup. 4 years ago
Tom Alexander 93f9581d8a
Renamed the new partial implementation to the old partial name. 4 years ago
Tom Alexander 7be00ffea6
Remove the old partial implementation. 4 years ago
Tom Alexander 10c8b25817
Implement the new partial type in the renderer. 4 years ago
Tom Alexander 402d8679e2
Switch the parser over to a new partial implementation for dynamic partials. 4 years ago
Tom Alexander 189dfb1755
Fix tests. 4 years ago
Tom Alexander c905e705ff
Transition to new literals compiling.
Tests still need work, as does the implementation for json.
4 years ago
Tom Alexander 30b7324049
Implement less-than. 4 years ago
Tom Alexander 1b63bc4083
Add a test for integer literals. 4 years ago
Tom Alexander c88cab8316
Hook in the integer parser. 4 years ago
Tom Alexander 79099a8654
Parsing positive integers. 4 years ago
Tom Alexander 7a8247f38a
Getting the left and right sides. 4 years ago
Tom Alexander d2904913ad
I think I have the full extraction code. 4 years ago
Tom Alexander 2a9657e3d5
Turns out the issue was the trailing space on the parameters. 4 years ago
Tom Alexander 369fbaf579
works fine with one parameter. 4 years ago
Tom Alexander 710785139a
Works fine with the partial but without parameters. 4 years ago
Tom Alexander 569b4594be
works fine without the partial. 4 years ago
Tom Alexander bb3449467a
Running into an error parsing one of the partial test templates. 4 years ago
Tom Alexander 2f515e068d
Implemented the renderer logic.
I should just need to implement ContextElement at this point.
4 years ago
Tom Alexander b45448edbd
Moved ParametersContext to its own file. 4 years ago