#ifdef CHECKING
static char *argrange = "Argument range error";
-#define check(expr) (expr || (xerror(argrange)))
+#define check(expr) (expr || !EM_error || (EM_error = argrange))
#else not CHECKING
#define check(x) /* nothing */
#endif CHECKING
if (ap->em_cst == ms_emx) {
if (wsize || psize) {
- xerror("Duplicate ms_emx");
+ if (!EM_error) EM_error = "Duplicate ms_emx";
}
argp = ap = getarg(cst_ptyp);
wsize = ap->em_cst;
/* Check that the last value is 0 or 1
*/
if (ap1->em_cst != 1 && ap1->em_cst != 0) {
- xerror("Third argument of hol/bss not 0/1");
+ if (! EM_error)
+ EM_error="Third argument of hol/bss not 0/1";
}
#endif CHECKING
break;
startmes(p);
break;
}
- if (!wsize) {
- xerror("EM code should start with mes 2");
+ if (!wsize && !EM_error) {
+ wsize = 2;
+ psize = 2;
+ EM_error = "EM code should start with mes 2";
}
- if (EM_error && p->em_type != EM_FATAL) p->em_type = EM_ERROR;
return p;
}
default:
assert(0);
case MES:
- xerror("String too long in message");
- /* p->em_type = EM_MESARG;
- p->em_arg = args;
- */
+ if (!EM_error)
+ EM_error = "String too long in message";
+ p->em_type = EM_MESARG;
+ p->em_arg = args;
break;
case CON:
p->em_type = EM_PSEU;
p->em_args = args;
break;
}
- if (EM_error && p->em_type != EM_FATAL) p->em_type = EM_ERROR;
return p;
}
/* Here, we are in a state reading arguments */
args = getarg(any_ptyp);
if (EM_error && p->em_type != EM_FATAL) {
- p->em_type = EM_ERROR;
return p;
}
if (!args) { /* No more arguments */
ap->em_noff = 0;
ap->em_argtype = nof_ptyp;
#ifdef CHECKING
- if (ap->em_dlb < 0) {
- xerror("Illegal data label");
+ if (ap->em_dlb < 0 && !EM_error) {
+ EM_error = "Illegal data label";
break;
}
#endif CHECKING
ap->em_ilb = get16();
ap->em_argtype = ilb_ptyp;
#ifdef CHECKING
- if (ap->em_ilb < 0) {
- xerror("Illegal instruction label");
+ if (ap->em_ilb < 0 && !EM_error) {
+ EM_error = "Illegal instruction label";
break;
}
#endif CHECKING
return 0;
}
- if ((typset & (1 << i)) == 0) {
- xerror("Bad argument type");
+ if ((typset & (1 << i)) == 0 && !EM_error) {
+ EM_error = "Bad argument type";
}
if (argtyp == sp_cend) return 0;
#else not CHECKING
#ifdef CHECKING
if (isident) {
- if (!checkident(s)) {
- xerror("Illegal identifier");
+ if (!checkident(s) && !EM_error) {
+ EM_error = "Illegal identifier";
}
}
#endif CHECKING
p->em_type = EM_DEFILB;
p->em_deflb = get16();
#ifdef CHECKING
- if (p->em_deflb < 0) {
- xerror("Illegal instruction label definition");
+ if (p->em_deflb < 0 && !EM_error) {
+ EM_error = "Illegal instruction label definition";
}
#endif CHECKING
break;
p->em_type = EM_DEFDLB;
p->em_deflb = get16();
#ifdef CHECKING
- if (p->em_deflb < 0) {
- xerror("Illegal data label definition");
+ if (p->em_deflb < 0 && !EM_error) {
+ EM_error = "Illegal data label definition";
}
#endif CHECKING
break;