"pos" is different (not a dict) with literal dicts
blueyed opened this issue · 0 comments
blueyed commented
Given t1.vim:
let mydict = #{one: 0}Given t2.vim:
let mydict = {"one": 0}Printing node in parse_expr9 shows:
{'type': 83, 'pos': {'i': 13, 'lnum': 1, 'col': 14, 'offset': 13}, 'value': [[{'type': 81, 'pos': 15, 'value': "'one'"}, {'type': 80, 'pos': {'i': 20, 'lnum': 1, 'col': 21, 'offset': 20}, 'value': '0'}]]} {'i': 13, 'lnum': 1, 'col': 14, 'offset': 13}
vs
{'type': 83, 'pos': {'i': 13, 'lnum': 1, 'col': 14, 'offset': 13}, 'value': [[{'type': 81, 'pos': {'i': 14, 'lnum': 1, 'col': 15, 'offset': 14}, 'value': '"one"'}, {'type': 80, 'pos': {'i': 21, 'lnum': 1, 'col': 22, 'offset': 21}, 'value': '0'}]]} {'i': 13, 'lnum': 1, 'col': 14, 'offset': 13}
Note that "pos" for the key is a dict in the second case, but only a number in the first one.
Related code:
vim-vimlparser/autoload/vimlparser.vim
Lines 4213 to 4218 in 9cc29ee
This causes an error in Vint then, which expects a dict there: Vimjas/vint#339.