Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Jemplate CPAN distribution.

Report information
The Basics
Id: 53454
Status: resolved
Priority: 0/
Queue: Jemplate

People
Owner: Nobody in particular
Requestors: gernotk [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: array range operator
Date: Thu, 07 Jan 2010 00:34:10 +0100
To: Bugs in Jemplate via RT <bug-Jemplate [...] rt.cpan.org>
From: Gernot Kieseritzky <gernotk [...] gmail.com>
in Perl-TT the following is legal code to produce a list: [% list = [1 .. 10] %] In Jemplate (0.23) a template containing any such statement will successfully compile but when being executed will trigger a JavaScript run-time error similar to "missing name after . operator" (as tested in firebug). To fix that Jemplate should either return a compile-time error or even better implement the array range operator.
Good ideas. I've implemented a rudimentary array range operator using Perl for positive and negative integers. Any other type of range operation will throw a compile time error. That is, the following WON'T work: [ 1 .. $end ] The following WILL work: [ 1 .. 10 ] # This is expanded at compile time If you'd like runtime expansion, it shouldn't be _too_ hard to do. It'd be great if you can submit a wishlist bug for this. Fixed with test case; thanks for the report.