275 Commits

Author SHA1 Message Date
Dirkjan Ochtman
ec5a2ebbb3 Change filters to return Result 2017-08-21 20:59:25 +02:00
Dirkjan Ochtman
4f4b5a3a65 Change one test case to use source attribute 2017-08-16 21:04:52 +02:00
Dirkjan Ochtman
ddbed4d807 Support specifying template source as an attribute 2017-08-16 21:04:43 +02:00
Dirkjan Ochtman
ffcbcd9f19 Pass path to code generation as Path 2017-08-16 21:01:08 +02:00
Dirkjan Ochtman
f15da8ba3e Change find_template_from_path() to take Path as start_at argument 2017-08-16 20:51:49 +02:00
Dirkjan Ochtman
7efd70297d Simplify relative path handling in find_template_from_path() 2017-08-16 20:40:34 +02:00
Dirkjan Ochtman
39b9e6e491 Use reference into AST for template path instead of cloning 2017-08-16 20:38:58 +02:00
Dirkjan Ochtman
5548cb1f4a Use enum for print option value 2017-08-16 20:38:58 +02:00
Dirkjan Ochtman
d7ac0825e0 Add test for variable declaration 2017-08-16 12:51:11 +02:00
Dirkjan Ochtman
05597b61da Allow separation of variable declaration and defintion 2017-08-16 12:50:52 +02:00
Dirkjan Ochtman
fb11c175b2 Add test for let blocks 2017-08-15 07:47:02 +02:00
Dirkjan Ochtman
34fd0c07de Add support for simple variable definition statements 2017-08-14 22:01:53 +02:00
Dirkjan Ochtman
9552bd5040 Introduce and clean up scopes where necessary 2017-08-14 22:01:02 +02:00
Dirkjan Ochtman
d83959d976 Assert invariant for SetChain implementation 2017-08-14 20:40:48 +02:00
Dirkjan Ochtman
5f3e93da3f Use error-chain to create a crate-specific Error type 2017-08-14 12:57:01 +02:00
Dirkjan Ochtman
69c447f0c7 Remove Cargo.lock
Apparently library crates generally don't include this in their repositories.
2017-08-14 12:28:06 +02:00
Dirkjan Ochtman
9dcba34f0d Define type askama::Result to use for all rendering methods 2017-08-14 12:22:48 +02:00
Anthony Nowell
0b814fd0fa Generate with full path to Result 2017-08-13 10:43:34 +02:00
Dirkjan Ochtman
8bda0d64d5 Inline scope tracking abstraction again 2017-08-10 21:49:15 +02:00
Dirkjan Ochtman
1a9a82ac7d Keep better track of nested scope through scope chains 2017-08-10 21:46:19 +02:00
Dirkjan Ochtman
44e4741504 Replace unwrap() with expect() call for parent type finding 2017-08-10 12:53:10 +02:00
Dirkjan Ochtman
68572d35ce Add note to template_dir() about being duplicated 2017-08-10 12:52:48 +02:00
Dirkjan Ochtman
cd685eefb4 Disable debug output for example by default 2017-08-10 12:52:31 +02:00
Dirkjan Ochtman
3b4c7e266b Update debugging example in README 2017-08-10 12:37:25 +02:00
Dirkjan Ochtman
e8c47b7135 Add README example as a test case 2017-08-10 12:37:01 +02:00
Dirkjan Ochtman
adfc52a26d Forgot to commit test template 2017-08-10 12:36:36 +02:00
Dirkjan Ochtman
420fd89174 Prevent allocations for loop target names 2017-08-10 12:22:07 +02:00
Dirkjan Ochtman
cece25b0be Implement Display for all Templates 2017-08-10 09:51:48 +02:00
Dirkjan Ochtman
1e0ee705a8 Propagate format errors and rename render_to() to render_into() 2017-08-10 09:27:33 +02:00
Dirkjan Ochtman
ffc74a1775 Add helper methods to abstract away dealing with scopes 2017-08-08 20:46:38 +02:00
Dirkjan Ochtman
3e1dbe4d6d Add some comments to clarify structure of the code generator 2017-08-08 20:45:57 +02:00
Dirkjan Ochtman
d40f5a3ea6 Reorganize code order in askama_derive modules 2017-08-08 20:29:43 +02:00
Dirkjan Ochtman
946e8c7587 Clean up use statements in code generator 2017-08-08 20:26:03 +02:00
Dirkjan Ochtman
aadc4a9aa2 Rewrite sentence from passive to active 2017-08-08 12:49:16 +02:00
Dirkjan Ochtman
647c8c0b52 Add some documentation about includes 2017-08-08 12:49:04 +02:00
Dirkjan Ochtman
52dee62de8 Update documentation on inheritance 2017-08-08 12:43:12 +02:00
Dirkjan Ochtman
2b8c71c4c0 Update README to clarify/update status 2017-08-08 12:39:19 +02:00
Dirkjan Ochtman
b7446b744a Add test for deref implementation (see #28) 2017-08-08 12:36:29 +02:00
Dirkjan Ochtman
e3d08c72bc Implement Deref<Parent> for inheriting templates (fixes #28) 2017-08-08 12:36:29 +02:00
Dirkjan Ochtman
20efa67bc1 Refactor handling of paths and trait names 2017-08-08 12:36:26 +02:00
Dirkjan Ochtman
a993920ae6 Move path_as_identifier() closer to driver 2017-08-08 12:18:34 +02:00
Dirkjan Ochtman
21e5c86ea2 Add some comments to clarify code generator methods 2017-08-08 12:17:11 +02:00
Dirkjan Ochtman
b3b9849f7e Simplify write_header() method by taking trait name directly 2017-08-08 12:14:22 +02:00
Dirkjan Ochtman
ed2fd2b105 Share HashSet for locals among nested Generators 2017-08-06 20:55:41 +02:00
Dirkjan Ochtman
47df34c0f0 Expand include node to template source during code generation 2017-08-06 14:59:27 +02:00
Dirkjan Ochtman
077c56c007 Use one way of finding templates on the path 2017-08-06 14:56:09 +02:00
Dirkjan Ochtman
b9cb5b82e6 Merge handling of trailing newline into get_template_source() 2017-08-06 14:51:56 +02:00
Dirkjan Ochtman
05f11a6843 Add test for path::get_template_source() 2017-08-06 14:48:55 +02:00
Dirkjan Ochtman
21885c06bf Allow parent templates to be specified as relative paths (fixes #26) 2017-08-06 14:44:35 +02:00
Dirkjan Ochtman
0514e4fec7 Add tests for find_template_from_path() 2017-08-06 14:44:35 +02:00