diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-10-08 17:59:01 -0400 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-10-08 17:59:01 -0400 |
commit | b5d98b762f5838a9d2659ac6619f343f61970201 (patch) | |
tree | 4391d762af6801b3e8815f945f9e59e7cad6c0a2 | |
parent | 25f7bc06e3c7ac93e1b2b06a9828c24471a5e7d2 (diff) | |
download | roux-b5d98b762f5838a9d2659ac6619f343f61970201.tar.gz |
use DEnd for strings too
-rw-r--r-- | lisc/parse.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/lisc/parse.c b/lisc/parse.c index b27e60c..22ab34b 100644 --- a/lisc/parse.c +++ b/lisc/parse.c @@ -753,26 +753,26 @@ parsedat(void cb(Dat *)) d.type = DA; d.u.str = tokval.str; cb(&d); - return; - } - if (t != TLBrace) - err("data contents must be { .. } or \" .. \""); - for (;;) { - switch (nextnl()) { - case TL: d.type = DL; break; - case TW: d.type = DW; break; - case TH: d.type = DH; break; - case TB: d.type = DB; break; + } else { + if (t != TLBrace) + err("data contents must be { .. } or \" .. \""); + for (;;) { + switch (nextnl()) { + case TL: d.type = DL; break; + case TW: d.type = DW; break; + case TH: d.type = DH; break; + case TB: d.type = DB; break; + } + if (nextnl() != TNum) + err("number expected"); + d.u.num = tokval.num; + cb(&d); + t = nextnl(); + if (t == TRBrace) + break; + if (t != TComma) + err(", or } expected"); } - if (nextnl() != TNum) - err("number expected"); - d.u.num = tokval.num; - cb(&d); - t = nextnl(); - if (t == TRBrace) - break; - if (t != TComma) - err(", or } expected"); } d.type = DEnd; cb(&d); |