aboutsummaryrefslogtreecommitdiffstats
path: root/askama_derive/src/generator.rs
diff options
context:
space:
mode:
authorLibravatar bott <mhpoin@gmail.com>2018-09-14 02:14:58 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2018-09-14 13:15:41 +0200
commit0711e3667b1e06e891b1b6972035d0330c5ae4c2 (patch)
treef586bf036a7f4c2c2e6c949265f3405351a47ee3 /askama_derive/src/generator.rs
parentc0f9fe973e6ff608f4f02f8a6cd39f2e9c50ea5c (diff)
downloadaskama-0711e3667b1e06e891b1b6972035d0330c5ae4c2.tar.gz
askama-0711e3667b1e06e891b1b6972035d0330c5ae4c2.tar.bz2
askama-0711e3667b1e06e891b1b6972035d0330c5ae4c2.zip
Fix operator preference at loop.index
Diffstat (limited to 'askama_derive/src/generator.rs')
-rw-r--r--askama_derive/src/generator.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs
index d0ac030..b6b5146 100644
--- a/askama_derive/src/generator.rs
+++ b/askama_derive/src/generator.rs
@@ -748,7 +748,7 @@ impl<'a> Generator<'a> {
if let Expr::Var(name) = *obj {
if name == "loop" {
if attr == "index" {
- buf.write("_loop_index + 1");
+ buf.write("(_loop_index + 1)");
return DisplayWrap::Unwrapped;
} else if attr == "index0" {
buf.write("_loop_index");