From bfa9af8f13f964ab46a28e17ea593c5983afa9cb Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Mon, 8 Jul 2013 20:51:10 +0300 Subject: [PATCH] Added error function. --- interpreter.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/interpreter.py b/interpreter.py index 21c26bb1a..26806f63b 100644 --- a/interpreter.py +++ b/interpreter.py @@ -706,6 +706,7 @@ class Interpreter(): def build_func_dict(self): self.funcs = {'project' : self.func_project, 'message' : self.func_message, + 'error' : self.func_error, 'executable': self.func_executable, 'dependency' : self.func_dependency, 'static_library' : self.func_static_lib, @@ -841,6 +842,10 @@ class Interpreter(): self.validate_arguments(args, 1, [str]) mlog.log(mlog.bold('Message:'), args[0]) + def func_error(self, node, args, kwargs): + self.validate_arguments(args, 1, [str]) + raise InterpreterException('Error encountered: ' + args[0]) + def add_languages(self, node, args): for lang in args: if lang in self.coredata.compilers: