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

Python slice notation is not parsed #290

Open
schnoeggi opened this issue Dec 8, 2024 · 0 comments
Open

Python slice notation is not parsed #290

schnoeggi opened this issue Dec 8, 2024 · 0 comments

Comments

@schnoeggi
Copy link

i recognized that Boa does not correctly parse the python slice notation.

For example
label = file_name.split('/')[:-2] will be parsed to label = file_name.split('/')[-2]

When looking at the AST of the expression i see that the colon is not captured:

{
....
            {
               "kind": "ARRAYINDEX",
               "expressions": [
                  {
                     "kind": "UNARY",
                     "expressions": [
                        {
                           "kind": "LITERAL",
                           "literal": "-"
                        },
                        {
                           "kind": "LITERAL",
                           "literal": "2"
                        }
                     ]
                  }
            ...
   ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants