diff --git a/src/userfns.c b/src/userfns.c index d30b1561..5c024ad2 100644 --- a/src/userfns.c +++ b/src/userfns.c @@ -349,7 +349,9 @@ int CallUserFunc(char const *name, int nargs, ParsePtr p) /* Skip the opening bracket, if there's one */ while (isempty(*s)) s++; - if (*s == BEG_OF_EXPR) s++; + if (*s == BEG_OF_EXPR) { + s++; + } push_call(f->filename, f->name, f->lineno); h = Evaluate(&s, f->locals, p); if (h == OK) { diff --git a/src/var.c b/src/var.c index dbc6021f..fc133e84 100644 --- a/src/var.c +++ b/src/var.c @@ -525,7 +525,9 @@ int DoSet (Parser *p) int r; DynamicBuffer buf; + DynamicBuffer buf2; DBufInit(&buf); + DBufInit(&buf2); r = ParseIdentifier(p, &buf); if (r) return r; @@ -541,6 +543,13 @@ int DoSet (Parser *p) return r; } + r = ParseToken(p, &buf2); + if (r) return r; + if (DBufLen(&buf2)) { + DBufFree(&buf2); + return E_EXPECTING_EOL; + } + DBufFree(&buf2); if (*DBufValue(&buf) == '$') r = SetSysVar(DBufValue(&buf)+1, &v); else r = SetVar(DBufValue(&buf), &v); if (buf.len > VAR_NAME_LEN) { diff --git a/tests/ansicolors.rem b/tests/ansicolors.rem index 6f195d09..db0ef1bb 100644 --- a/tests/ansicolors.rem +++ b/tests/ansicolors.rem @@ -4,7 +4,7 @@ MSG UseVTColors is: [$UseVTColors]% MSG Use256Colors is: [$Use256Colors]% MSG UseTrueColors is: [$UseTrueColors]% MSG UseBGVTColors is: [$UseBGVTColors]% -set n ansicolor("")] +set n ansicolor("") MSG This is [ansicolor(0,255,0)]green[n], [ansicolor("255 0 0")]red[n] and [ansicolor("0 0 255")]blue[n] text.% MSG This is [ansicolor(0,0,0)][ansicolor(0,255,0,1)]black text on a green background[n]% MSG This is [ansicolor(0,0,0,0,1)]clamped black text[n]% diff --git a/tests/test.cmp b/tests/test.cmp index 80dcdb5a..b9b9694f 100644 --- a/tests/test.cmp +++ b/tests/test.cmp @@ -4833,6 +4833,11 @@ REM 2 Jan 1990 MSG ["bad_expr" * 2] ../tests/test.rem(887): Expired SET $ParseUntriggered 1 +# Should result in errors +set pqxya 1+2) +1 + 2 => 3 +../tests/test.rem(891): Expecting end-of-line + # Don't want Remind to queue reminders EXIT diff --git a/tests/test.rem b/tests/test.rem index b2365a39..ae0863d1 100644 --- a/tests/test.rem +++ b/tests/test.rem @@ -887,6 +887,9 @@ SET $ParseUntriggered 0 REM 2 Jan 1990 MSG ["bad_expr" * 2] SET $ParseUntriggered 1 +# Should result in errors +set pqxya 1+2) + # Don't want Remind to queue reminders EXIT