#include "asserts.h"
#include "error.h"
#include "expr.h"
+#include "lineinfo.h"
#include "objfile.h"
-#include "scanner.h"
#include "spool.h"
ExprNode* Expr; /* Expression to evaluate */
AssertAction Action; /* Action to take */
unsigned Msg; /* Message to print (if any) */
- FilePos Pos; /* File position of assertion */
+ Collection LI; /* Line infos for the assertion */
};
/* Collection with all assertions for a module */
A->Expr = Expr;
A->Action = Action;
A->Msg = Msg;
- A->Pos = CurTok.Pos;
+ A->LI = EmptyCollection;
+ GetFullLineInfo (&A->LI, 1);
/* Return the new struct */
return A;
switch (A->Action) {
case ASSERT_ACT_WARN:
- PWarning (&A->Pos, 0, "%s", Msg);
+ LIWarning (&A->LI, 0, "%s", Msg);
break;
case ASSERT_ACT_ERROR:
- PError (&A->Pos, "%s", Msg);
+ LIError (&A->LI, "%s", Msg);
break;
default:
WriteExpr (A->Expr);
ObjWriteVar ((unsigned) A->Action);
ObjWriteVar (A->Msg);
- ObjWritePos (&A->Pos);
+ WriteLineInfo (&A->LI);
}
/* Done writing the assertions */
-
+