diff options
| author | 2026-10-14 16:14:01 +0330 | |
|---|---|---|
| committer | 2026-10-14 16:14:01 +0330 | |
| commit | 45b53ef93135b240989d88b065f7ee7f12a95bfb (patch) | |
| tree | 275f39cfa2f7b4d424f6f0a87fa7fbcae3c1e53d /src/tools/zc0.c | |
| parent | zc0: 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/zc0.c')
| -rw-r--r-- | src/tools/zc0.c | 5 |
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(); |
