Fixed line and column numbers for dict and array nodes

pull/4814/head
Daniel Mensinger 6 years ago
parent 8dd9b44831
commit e089eb7665
No known key found for this signature in database
GPG Key ID: 54DD94C131E277D4
  1. 16
      mesonbuild/mparser.py

@ -262,17 +262,17 @@ class BreakNode(ElementaryNode):
pass
class ArrayNode(BaseNode):
def __init__(self, args):
def __init__(self, args, lineno, colno):
self.subdir = args.subdir
self.lineno = args.lineno
self.colno = args.colno
self.lineno = lineno
self.colno = colno
self.args = args
class DictNode(BaseNode):
def __init__(self, args):
def __init__(self, args, lineno, colno):
self.subdir = args.subdir
self.lineno = args.lineno
self.colno = args.colno
self.lineno = lineno
self.colno = colno
self.args = args
class EmptyNode(BaseNode):
@ -638,11 +638,11 @@ class Parser:
elif self.accept('lbracket'):
args = self.args()
self.block_expect('rbracket', block_start)
return ArrayNode(args)
return ArrayNode(args, block_start.lineno, block_start.colno)
elif self.accept('lcurl'):
key_values = self.key_values()
self.block_expect('rcurl', block_start)
return DictNode(key_values)
return DictNode(key_values, block_start.lineno, block_start.colno)
else:
return self.e9()

Loading…
Cancel
Save