summaryrefslogtreecommitdiff
path: root/graphics/asymptote/errormsg.h
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/asymptote/errormsg.h')
-rw-r--r--graphics/asymptote/errormsg.h46
1 files changed, 23 insertions, 23 deletions
diff --git a/graphics/asymptote/errormsg.h b/graphics/asymptote/errormsg.h
index 22e7f79f1f..180c2309f7 100644
--- a/graphics/asymptote/errormsg.h
+++ b/graphics/asymptote/errormsg.h
@@ -31,7 +31,7 @@ public:
{
return lineNum;
}
-
+
string name() const {
return filename;
}
@@ -52,12 +52,12 @@ public:
return filename.substr(start, end-start);
}
-
+
// Specifies a newline symbol at the character position given.
void newline() {
++lineNum;
}
-
+
};
inline bool operator == (const fileinfo& a, const fileinfo& b)
@@ -85,17 +85,17 @@ public:
{
return file ? file->name() : "";
}
-
+
size_t Line() const
{
return line;
}
-
+
size_t Column() const
{
return column;
}
-
+
std::pair<size_t,size_t>LineColumn() const {
return std::pair<size_t,size_t>(line,column);
}
@@ -103,20 +103,20 @@ public:
bool match(const string& s) {
return file && file->name() == s;
}
-
+
bool match(size_t l) {
return line == l;
}
-
+
bool matchColumn(size_t c) {
return column == c;
}
-
+
bool operator! () const
{
return (file == 0);
}
-
+
friend ostream& operator << (ostream& out, const position& pos);
// Write out just the module name and line number.
@@ -133,27 +133,27 @@ extern position nullPos;
struct nullPosInitializer {
nullPosInitializer() {nullPos.init(NULL,0);}
};
-
+
inline bool operator == (const position& a, const position& b)
{
- return a.Line() == b.Line() && a.Column() == b.Column() &&
- a.filename() == b.filename();
+ return a.Line() == b.Line() && a.Column() == b.Column() &&
+ a.filename() == b.filename();
}
string warning(string s);
-
+
class errorstream {
ostream& out;
bool anyErrors;
bool anyWarnings;
bool floating; // Was a message output without a terminating newline?
-
+
// Is there an error that warrants the asy process to return 1 instead of 0?
bool anyStatusErrors;
public:
static bool interrupt; // Is there a pending interrupt?
-
+
errorstream(ostream& out = cerr)
: out(out), anyErrors(false), anyWarnings(false), floating(false),
anyStatusErrors(false) {}
@@ -162,11 +162,11 @@ public:
void clear();
void message(position pos, const string& s);
-
+
void Interrupt(bool b) {
interrupt=b;
}
-
+
// An error is encountered, not in the user's code, but in the way the
// compiler works! This may be augmented in the future with a message
// to contact the compiler writers.
@@ -184,13 +184,13 @@ public:
// Indicate potential problems in the code, but the code is still usable.
void warning(position pos);
void warning(position pos, string s);
-
+
// Single a fatal error and execute the main process.
void fatal(position pos);
-
+
// Print out position in code to aid debugging.
void trace(position pos);
-
+
// Sends stuff to out to print.
// NOTE: May later make it do automatic line breaking for long messages.
template<class T>
@@ -205,11 +205,11 @@ public:
void sync();
void cont();
-
+
bool errors() const {
return anyErrors;
}
-
+
bool warnings() const {
return anyWarnings || errors();
}