Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for index-based arrays slicing #120

Open
flexferrum opened this issue Jun 19, 2019 · 2 comments
Open

Support for index-based arrays slicing #120

flexferrum opened this issue Jun 19, 2019 · 2 comments
Labels
bug Something isn't working hacktoberfest Issues for Hacktoberfest
Milestone

Comments

@flexferrum
Copy link
Collaborator

flexferrum commented Jun 19, 2019

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

It needs to be supported.

@flexferrum flexferrum added the bug Something isn't working label Jun 19, 2019
@flexferrum flexferrum added this to the Release 1.0 milestone Jun 19, 2019
@flexferrum flexferrum added this to To Do in Jinja2Cpp standard features via automation Jun 19, 2019
@flexferrum flexferrum added the hacktoberfest Issues for Hacktoberfest label Sep 8, 2019
@layderv
Copy link

layderv commented Oct 14, 2019

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?

@flexferrum
Copy link
Collaborator Author

flexferrum commented Oct 14, 2019

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 flexferrum moved this from To Do to In Progress in Jinja2Cpp standard features Oct 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hacktoberfest Issues for Hacktoberfest
Projects
Development

No branches or pull requests

2 participants