From 4048ee8150cad5253fd6f0245c9a357484eac3f2 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Tue, 11 Nov 2014 15:09:21 +0100 Subject: refactored SciTECO runtime errors: moved from parser.cpp to error.cpp * the GError expection has been renamed to GlibError, to avoid nameclashes when working from the SciTECO namespace --- src/expressions.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/expressions.cpp') diff --git a/src/expressions.cpp b/src/expressions.cpp index 5bad38a..f8a81da 100644 --- a/src/expressions.cpp +++ b/src/expressions.cpp @@ -23,7 +23,7 @@ #include "sciteco.h" #include "undo.h" -#include "parser.h" // State::Error +#include "error.h" #include "expressions.h" namespace SciTECO { @@ -137,11 +137,11 @@ Expressions::calc(void) tecoInt vleft; if (operators.peek() != OP_NUMBER) - throw State::Error("Missing right operand"); + throw Error("Missing right operand"); vright = pop_num(); op = pop_op(); if (operators.peek() != OP_NUMBER) - throw State::Error("Missing left operand"); + throw Error("Missing left operand"); vleft = pop_num(); switch (op) { @@ -153,12 +153,12 @@ Expressions::calc(void) break; case OP_DIV: if (!vright) - throw State::Error("Division by zero"); + throw Error("Division by zero"); result = vleft / vright; break; case OP_MOD: if (!vright) - throw State::Error("Remainder of division by zero"); + throw Error("Remainder of division by zero"); result = vleft % vright; break; case OP_ADD: -- cgit v1.2.3