cargo: Builder: Add dict support

pull/12110/head
Xavier Claessens 1 year ago committed by Xavier Claessens
parent b5b952688f
commit 3334addbbd
  1. 11
      mesonbuild/cargo/builder.py

@ -72,6 +72,17 @@ class Builder:
args.arguments = value
return mparser.ArrayNode(self._symbol('['), args, self._symbol(']'))
def dict(self, value: T.Dict[mparser.BaseNode, mparser.BaseNode]) -> mparser.DictNode:
"""Build an Dictionary Node
:param value: A dict of nodes to insert into the dictionary
:return: An DictNode built from the arguments
"""
args = mparser.ArgumentNode(self._token('dict', 'unused'))
for key, val in value.items():
args.set_kwarg_no_check(key, val)
return mparser.DictNode(self._symbol('{'), args, self._symbol('}'))
def identifier(self, value: str) -> mparser.IdNode:
"""Build A IdNode

Loading…
Cancel
Save