Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Use "target()" to parse "when" block | René Kijewski | 2021-07-30 | 8 | -253/+161 |
| | | | | | | | | | | | | `target()` as used in parsing "let" and "if let" implements parsing nested tuples and structs. But it does not implement parsing literals. The functions `match_variant()` and `with_parameters()` as used in parsing "when" blocks do not implement parsing nested structs, but it implements parsing literals. This PR combines `match_variant()` and `with_parameters()` into `target()`, so that all `{%when%}` support nested structs, too. | ||||
* | Allow omitting "with" keyword in match blocks | René Kijewski | 2021-07-30 | 2 | -1/+18 |
| | | | | | | | | | Askama uses the syntax `{% when Variant with (parameters) %}` in `{% match %}` blocks. This is done because Askama does not implement the whole pattern matching of Rust's `match` statements. This PR wants to bring Askama a step closer Rust's matching, so the "with" keyword should not be needed anymore. | ||||
* | Allow using "with" keyword in "let" statements | René Kijewski | 2021-07-30 | 2 | -0/+15 |
| | | | | | | | | Askama uses the syntax `{% when Variant with (parameters) %}` in `{% match %}` blocks. This change allows the optional use of the keyword "with" in "let" and "if let" statements, too. | ||||
* | Silence clippy warning from Rust 1.54 | Dirkjan Ochtman | 2021-07-30 | 1 | -0/+1 |
| | |||||
* | Implement destructoring of structs | René Kijewski | 2021-07-05 | 3 | -8/+166 |
| | | | | | This PR implements the destructoring of structs on the lhs of "let" and "for" statements. | ||||
* | Add "destructoring tuple in loop" test | René Kijewski | 2021-07-05 | 1 | -0/+69 |
| | |||||
* | Add tuple destructoring tests | René Kijewski | 2021-07-05 | 2 | -0/+17 |
| | |||||
* | Parse nested tuples in "let" statement lhs | René Kijewski | 2021-07-05 | 2 | -17/+35 |
| | |||||
* | Add loop variable shadowing test | René Kijewski | 2021-07-05 | 1 | -0/+21 |
| | |||||
* | Reduce code duplication for writing targets | René Kijewski | 2021-07-05 | 1 | -22/+9 |
| | | | | | This change also fixes a bug in the loop generator, which failed for shadowed variables. | ||||
* | Move logic where target shadows or declares a variable into method | René Kijewski | 2021-07-05 | 1 | -23/+33 |
| | |||||
* | Remove needless deref, only to ref it a few lines down | René Kijewski | 2021-07-05 | 1 | -4/+4 |
| | |||||
* | Remove duplicated code in generator | René Kijewski | 2021-07-05 | 1 | -17/+1 |
| | |||||
* | Prepare generator::visit_target() for nested targets | René Kijewski | 2021-07-05 | 1 | -4/+2 |
| | | | | | | | | By now only non-nested tuples are accepted by the parser, but this will change. This change makes visit_target() call itself for items in a tuple. So enable the function to call itself, I needed to fix the lifetime annotation, because the references inside a Target instance may outlife a reference to instance itself. | ||||
* | Replace rust_macro test to work on nightly | René Kijewski | 2021-07-02 | 2 | -14/+18 |
| | | | | | | | | | | | | | | | | The current rust_test uses `stringify!()`. The documentation gives us the warning: > Note that the expanded results of the input tokens may change in the > future. You should be careful if you rely on the output. In the current nightly rust the result was indeed changed, so the test not fails. This PR replaces the test with another macro, that does not depend on `stringify!()`. Closes issue #504. | ||||
* | Fix expected error message for missing file | René Kijewski | 2021-07-02 | 6 | -0/+16 |
| | | | | | | | | | rust-lang/rust#82069 made error message that stem macro invocations more verbose. Since Rust 1.54 (currently in beta) the message includes the name of the offending macro. This PR uses version_check to select the appropriate expected error message. | ||||
* | Stop eliding lifetimes in paths | Dirkjan Ochtman | 2021-07-01 | 15 | -105/+140 |
| | |||||
* | Add "if let" tests | René Kijewski | 2021-07-01 | 5 | -0/+119 |
| | |||||
* | Implement "if let" statement | René Kijewski | 2021-07-01 | 2 | -17/+54 |
| | |||||
* | Use "if let Some(_)" instead of match | René Kijewski | 2021-07-01 | 1 | -21/+18 |
| | |||||
* | Move visit_match_params into its own method | René Kijewski | 2021-07-01 | 1 | -38/+42 |
| | |||||
* | Fix a clippy::needless-borrow warning in askama_shared | René Kijewski | 2021-07-01 | 1 | -1/+1 |
| | |||||
* | Added loop tests | vallentin | 2021-06-23 | 1 | -0/+83 |
| | |||||
* | Fixed loop generator when accessing field (fixes 494) | vallentin | 2021-06-23 | 1 | -0/+6 |
| | |||||
* | Fix code generation for macro calls that store args in variables. | Ryan Kelly | 2021-06-22 | 3 | -1/+23 |
| | |||||
* | Support rocket 0.5.0-rc.1 based on @flo-l's PR (#495) | Shritesh Bhattarai | 2021-06-15 | 4 | -14/+10 |
| | | | See #412 for earlier iteration. | ||||
* | Fix needless borrowing | Dirkjan Ochtman | 2021-06-14 | 2 | -6/+6 |
| | |||||
* | Remove forward-slash escape (#486) | Alex Wennerberg | 2021-05-17 | 3 | -7/+3 |
| | | | | | | | | | | | | | | | This was based off of the OWASP XSS prevention cheat sheet -- https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html#output-encoding-rules-summary However, there isn't really any attack vector based on forward slash alone, and it's being removed in the next version of that document. > There is no proof that escaping forward slash will improve > defense against XSS, if all other special characters are escaped > properly, but it forces developers to use non-standard implementation of > the HTML escaping, what increases the risk of the mistake and makes the > implementation harder. https://github.com/OWASP/CheatSheetSeries/pull/516 | ||||
* | Fixed not found in scope error | vallentin | 2021-04-29 | 1 | -1/+1 |
| | |||||
* | Tweak dependabot ignore settings | Dirkjan Ochtman | 2021-04-29 | 1 | -9/+1 |
| | |||||
* | Add section to README for IDE plugins (#474) | SamJakob | 2021-04-29 | 1 | -0/+1 |
| | |||||
* | Upgrade to GitHub-native Dependabot | dependabot-preview[bot] | 2021-04-29 | 1 | -0/+24 |
| | |||||
* | Use raw identifiers for identifiers which collide with Rust keywords (#476) | SciStarterOwner | 2021-04-21 | 1 | -4/+84 |
| | | | Co-authored-by: Daniel Arbuckle <djarb@highenergymagic.org> | ||||
* | Eliminate common tails from branches | Dirkjan Ochtman | 2021-04-13 | 2 | -8/+4 |
| | |||||
* | askama_tide: suppress clippy::from-over-into lint | Dirkjan Ochtman | 2021-03-30 | 1 | -0/+2 |
| | |||||
* | Use mem::take() where applicable | Dirkjan Ochtman | 2021-03-30 | 1 | -2/+2 |
| | |||||
* | Rename test types to PascalCase | Dirkjan Ochtman | 2021-03-30 | 2 | -10/+10 |
| | |||||
* | updated the book to describe the new paragraphbreaks filter | mbuscemi | 2021-03-22 | 1 | -0/+18 |
| | |||||
* | added paragraphbreaks function | mbuscemi | 2021-03-22 | 1 | -1/+30 |
| | |||||
* | askama_gotham: bump version to 0.12.0 | Dirkjan Ochtman | 2021-03-22 | 1 | -1/+1 |
| | |||||
* | askama_gotham: bump to 0.6 | Dirkjan Ochtman | 2021-03-22 | 1 | -2/+2 |
| | |||||
* | Update version in README.md | technic93 | 2021-03-21 | 1 | -1/+1 |
| | |||||
* | fix typo in docstring | technic93 | 2021-03-14 | 1 | -1/+1 |
| | |||||
* | Added path and ext tests | vallentin | 2021-03-10 | 4 | -0/+70 |
| | |||||
* | Changed to allow both path and ext | vallentin | 2021-03-10 | 1 | -5/+2 |
| | |||||
* | Added extension tests | vallentin | 2021-03-10 | 1 | -0/+48 |
| | |||||
* | Fixed extension to ignore common jinja extensions (fixes #457) | vallentin | 2021-03-10 | 1 | -1/+11 |
| | |||||
* | Refactored getting path extension | vallentin | 2021-03-10 | 2 | -36/+17 |
| | |||||
* | Fix style suggestion per nightly clippy | Dirkjan Ochtman | 2021-02-28 | 1 | -1/+1 |
| | |||||
* | Reworked constants to be parsed as paths | vallentin | 2021-02-23 | 2 | -11/+26 |
| |