Method calls work now.

pull/15/head
Jussi Pakkanen 11 years ago
parent 967f0110a5
commit 163a31beef
  1. 8
      interpreter.py
  2. 8
      parsertest.py

@ -1054,7 +1054,7 @@ class Interpreter():
code = open(absname).read()
assert(isinstance(code, str))
try:
codeblock = mparser.build_ast(code)
codeblock = mparser2.Parser(code).parse()
except coredata.MesonException as me:
me.file = buildfilename
raise me
@ -1273,16 +1273,16 @@ class Interpreter():
return templ
def method_call(self, node):
invokable = node.invokable
invokable = node.source_object
if isinstance(invokable, mparser2.IdNode):
object_name = invokable.value
obj = self.get_variable(object_name)
else:
obj = self.evaluate_statement(invokable)
method_name = node.method_name.get_value()
method_name = node.name
if method_name == 'extract_objects' and self.environment.coredata.unity:
raise InterpreterException('Single object files can not be extracted in Unity builds.')
args = node.arguments
args = node.args
if isinstance(obj, nodes.StringStatement):
obj = obj.get_value()
if isinstance(obj, str):

@ -243,10 +243,12 @@ class ArgumentNode():
self.order_error = False
def prepend(self, statement):
self.arguments = [statement] + self.arguments
if not isinstance(statement, EmptyNode):
self.arguments = [statement] + self.arguments
def append(self, statement):
self.arguments = self.arguments + [statement]
if not isinstance(statement, EmptyNode):
self.arguments = self.arguments + [statement]
def set_kwarg(self, name, value):
if self.num_args() > 0:
@ -405,7 +407,7 @@ class Parser:
a.set_kwarg(s.value, value)
return a
a = ArgumentNode(self.current)
a.arguments.append(s)
a.append(s)
return a
def method_call(self, source_object):

Loading…
Cancel
Save