Jinja2Cpp icon indicating copy to clipboard operation
Jinja2Cpp copied to clipboard

Support for index-based arrays slicing

Open flexferrum opened this issue 5 years ago • 2 comments

Jinja2 index operator [] follows the python arrays slicing semantic: https://stackoverflow.com/questions/509211/understanding-slice-notation

It needs to be supported.

flexferrum avatar Jun 19 '19 14:06 flexferrum

For the parser, it looks like ParseSubscript() is to be updated to support [ : : ].

For the evaluator, I think SubscriptExpression::Evaluate is the one to edit, but I don't quite understand how / the types that are involved in that method. Can I get any suggestion please?

layderv avatar Oct 14 '19 18:10 layderv

For the evaluator

I've considered to add new AST node for this purpose, something like SliceExpression, because indexing and slicing has got too different behavior.

flexferrum avatar Oct 14 '19 18:10 flexferrum