diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2014-11-11 15:09:21 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2014-11-11 15:09:21 +0100 |
commit | 4048ee8150cad5253fd6f0245c9a357484eac3f2 (patch) | |
tree | 2434df63c0766d6c2f8f8294af9104697f4abae2 /src/expressions.cpp | |
parent | 7206f6d1249da0dd8e879d0c0b26185fc6ef89d9 (diff) | |
download | sciteco-4048ee8150cad5253fd6f0245c9a357484eac3f2.tar.gz |
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
Diffstat (limited to 'src/expressions.cpp')
-rw-r--r-- | src/expressions.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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: |