aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2013-07-30 22:40:45 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2013-07-30 22:40:45 +0300
commita569807766bff160f2c35f6a22dee8c53482df73 (patch)
treeca1eee5b68ff08e34d43b2945882be7f11bc56ca
parent26afdb49d72ac478fa9b1346ea9de7381d9ced45 (diff)
downloadmeson-a569807766bff160f2c35f6a22dee8c53482df73.zip
meson-a569807766bff160f2c35f6a22dee8c53482df73.tar.gz
meson-a569807766bff160f2c35f6a22dee8c53482df73.tar.bz2
A straw broke the camel's back. Now we convert all data type to native ones as soon as possible.
-rw-r--r--interpreter.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/interpreter.py b/interpreter.py
index db50922..f3ac9ee 100644
--- a/interpreter.py
+++ b/interpreter.py
@@ -1117,6 +1117,8 @@ class Interpreter():
def flatten(self, args):
if isinstance(args, nodes.StringStatement):
return args.get_value()
+ if isinstance(args, str):
+ return args
result = []
for a in args:
if isinstance(a, list):
@@ -1160,10 +1162,7 @@ class Interpreter():
def is_assignable(self, value):
if isinstance(value, InterpreterObject) or \
isinstance(value, dependencies.Dependency) or\
- isinstance(value, nodes.StringStatement) or\
isinstance(value, str) or\
- isinstance(value, nodes.BoolStatement) or\
- isinstance(value, nodes.IntStatement) or\
isinstance(value, int) or \
isinstance(value, list):
return True
@@ -1177,6 +1176,7 @@ class Interpreter():
value = self.evaluate_statement(node.value)
if value is None:
raise InvalidCode('Can not assign None to variable.')
+ value = self.to_native(value)
if not self.is_assignable(value):
raise InvalidCode('Tried to assign an invalid value to variable.')
self.set_variable(var_name, value)