Commit acdbeaa6 by Aaron Leung

Error handling in comparison operators.

parent 28eac700
......@@ -21,7 +21,9 @@ div[hux ~= "hello"] {
hux: blux;
foo: boo;
dux: "hello" + "goodbye";
shux: "hello" + 12;
frux: 12 + "hello";
shux: 'hello' + 12;
frux: 12 + 'hello';
blah: blah;
hoo: blah == 12;
boo: 12px >= 3em;
}
......@@ -5,6 +5,7 @@
#include <cstdlib>
#include <cmath>
#include "node.hpp"
#include "error.hpp"
using std::string;
using std::stringstream;
......@@ -82,11 +83,11 @@ namespace Sass {
return numeric_value() < rhs.numeric_value();
}
else {
// TO DO: throw an exception ("units don't match")
throw Error(Error::evaluation, line_number, "", "incompatible units");
}
}
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