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

Colon included in identifier name (e.g. foo[bar:]) #79

Open
blueyed opened this issue Jan 14, 2018 · 1 comment · May be fixed by #81
Open

Colon included in identifier name (e.g. foo[bar:]) #79

blueyed opened this issue Jan 14, 2018 · 1 comment · May be fixed by #81
Labels

Comments

@blueyed
Copy link
Contributor

blueyed commented Jan 14, 2018

Given t-undef-slice.py:

import pprint
import vimlparser

s = vimlparser.StringReader(['echo foo[bar:]'])
pprint.pprint(vimlparser.VimLParser(s).parse(s))

Running PYTHONPATH=py python t-undef-slice.py displays:

{'body': [{'ea': {'addr_count': 0,
                  'amount': 0,
                  'append': 0,
                  'argcmd': {},
                  'argopt': {},
                  'argpos': {'col': 6, 'i': 5, 'lnum': 1, 'offset': 5},
                  'bad_char': 0,
                  'cmd': {'flags': 'EXTRA|NOTRLCOM|SBOXOK|CMDWIN',
                          'minlen': 2,
                          'name': 'echo',
                          'parser': 'parse_cmd_echo'},
                  'cmdpos': {'col': 1, 'i': 0, 'lnum': 1, 'offset': 0},
                  'do_ecmd_cmd': '',
                  'do_ecmd_lnum': 0,
                  'flags': 0,
                  'force_bin': 0,
                  'force_enc': 0,
                  'force_ff': 0,
                  'forceit': 0,
                  'line1': 0,
                  'line2': 0,
                  'linepos': {'col': 1, 'i': 0, 'lnum': 1, 'offset': 0},
                  'modifiers': [],
                  'range': [],
                  'read_edit': 0,
                  'regname': 0,
                  'usefilter': 0},
           'list': [{'left': {'pos': {'col': 6, 'i': 5, 'lnum': 1, 'offset': 5},
                              'type': 86,
                              'value': 'foo'},
                     'pos': {'col': 9, 'i': 8, 'lnum': 1, 'offset': 8},
                     'right': {'pos': {'col': 10,
                                       'i': 9,
                                       'lnum': 1,
                                       'offset': 9},
                               'type': 86,
                               'value': 'bar:'},
                     'type': 76}],
           'pos': {'col': 1, 'i': 0, 'lnum': 1, 'offset': 0},
           'type': 28}],
 'pos': {'col': 1, 'i': 0, 'lnum': 1, 'offset': 0},
 'type': 1}

Note the value bar: (with leading :) for the identifier.
It should be just bar.

blueyed added a commit to blueyed/vim-vimlparser that referenced this issue Jan 14, 2018
@blueyed blueyed linked a pull request Jan 14, 2018 that will close this issue
@tyru
Copy link
Member

tyru commented Mar 6, 2020

This can also reproduce.

let x = 'x'
let d = { x: 2 }

#158

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants