Skip to content

Python slice notation is not parsed #290

Description

@schnoeggi

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"
                        }
                     ]
                  }
            ...
   ]
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions