Commit acdbeaa6 by Aaron Leung

Error handling in comparison operators.

parent 28eac700
...@@ -21,7 +21,9 @@ div[hux ~= "hello"] { ...@@ -21,7 +21,9 @@ div[hux ~= "hello"] {
hux: blux; hux: blux;
foo: boo; foo: boo;
dux: "hello" + "goodbye"; dux: "hello" + "goodbye";
shux: "hello" + 12; shux: 'hello' + 12;
frux: 12 + "hello"; frux: 12 + 'hello';
blah: blah; blah: blah;
hoo: blah == 12;
boo: 12px >= 3em;
} }
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <cstdlib> #include <cstdlib>
#include <cmath> #include <cmath>
#include "node.hpp" #include "node.hpp"
#include "error.hpp"
using std::string; using std::string;
using std::stringstream; using std::stringstream;
...@@ -82,11 +83,11 @@ namespace Sass { ...@@ -82,11 +83,11 @@ namespace Sass {
return numeric_value() < rhs.numeric_value(); return numeric_value() < rhs.numeric_value();
} }
else { else {
// TO DO: throw an exception ("units don't match") throw Error(Error::evaluation, line_number, "", "incompatible units");
} }
} }
else { else {
// TO DO: throw an exception ("incomparable types") throw Error(Error::evaluation, line_number, "", "incomparable types");
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment