aboutsummaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-14 16:14:01 +0330
committerGravatar zinc <zinc@downsta.ir> 2026-10-14 16:14:01 +0330
commit45b53ef93135b240989d88b065f7ee7f12a95bfb (patch)
tree275f39cfa2f7b4d424f6f0a87fa7fbcae3c1e53d /src/tools
parentzc0: string literals have no length limit (the token text grows) (diff)
zc0: reject .u on a typed parameter with the compiler's message
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/zc0.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tools/zc0.c b/src/tools/zc0.c
index fc60ddf..20dcbf9 100644
--- a/src/tools/zc0.c
+++ b/src/tools/zc0.c
@@ -831,7 +831,10 @@ static void fndef(int ret, int rstr) /* rstr: the return type is bstr */
if (!accept(")")) {
do {
t = 0; ptag = 0; pstr[np & 15] = 0;
- if (optype() >= 0) { t = ptag == 1 ? 1 : ptag == 2 ? 2 : 0; pstr[np & 15] = ptstr; } /* the type is read and dropped */
+ if (optype() >= 0) { /* the type is read and dropped */
+ if (ptag == 3) die("a parameter tag is .m or .d"); /* the compiler's message: .u is only a return tag */
+ t = ptag == 1 ? 1 : ptag == 2 ? 2 : 0; pstr[np & 15] = ptstr;
+ }
else if (accept(".")) { /* .m name, .d name */
if (is("m")) t = 1; else if (is("d")) t = 2; else die("a parameter tag is .m or .d");
next();