diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-09-22 17:28:03 -0400 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-09-22 17:28:07 -0400 |
commit | 12cfd93e26a837875fdeef4e871277a67e12d083 (patch) | |
tree | a87cc17d66eb8d605b45ffae11a79b7e616821de /lisc/parse.c | |
parent | 3ef1d83866fa07a44cc6ff3908da3fb57de61142 (diff) | |
download | roux-12cfd93e26a837875fdeef4e871277a67e12d083.tar.gz |
improve error reporting in the parser
Diffstat (limited to 'lisc/parse.c')
-rw-r--r-- | lisc/parse.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lisc/parse.c b/lisc/parse.c index 76c2d65..a6957f2 100644 --- a/lisc/parse.c +++ b/lisc/parse.c @@ -515,8 +515,12 @@ parseline(PState ps) JRetc, JRet0 }[rcls]; curb->jmp.rettyn = rtyn; - if (rcls < 3) - curb->jmp.arg = parseref(); + if (rcls < 3) { + r = parseref(); + if (req(r, R)) + err("return value expected"); + curb->jmp.arg = r; + } goto Close; case TJmp: curb->jmp.type = JJmp; |