From 49b82fcfda542b8db21073e6fceb4ac79984600d Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Sun, 22 Feb 2009 19:51:13 +0800 Subject: [PARSER] Use CHKNL to parse case statements Instead of open-coding the newline loop, use the CHKNL flag to get readtoken to eat the newlines before the in keyword for the case statement. Signed-off-by: Herbert Xu --- ChangeLog | 1 + src/parser.c | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index d7e0f79..2c955e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ * Remove EXSIG. * Do not close stderr when /dev/tty fails to open. * Allow newlines after var name in for statements. + * Use CHKNL to parse case statements. 2009-01-14 Herbert Xu diff --git a/src/parser.c b/src/parser.c index 425c457..dad1037 100644 --- a/src/parser.c +++ b/src/parser.c @@ -402,10 +402,8 @@ TRACE(("expecting DO got %s %s\n", tokname[got], got == TWORD ? wordtext : "")); n2->narg.text = wordtext; n2->narg.backquote = backquotelist; n2->narg.next = NULL; - do { - checkkwd = CHKKWD | CHKALIAS; - } while (readtoken() == TNL); - if (lasttoken != TIN) + checkkwd = CHKNL | CHKKWD | CHKALIAS; + if (readtoken() != TIN) synexpect(TIN); cpp = &n1->ncase.cases; next_case: -- cgit 1.4.1 iff/listen.c?h=2.4&id=0e7a552a55d44006aa035d7cc4a2e216833322ce&follow=1'>diff
Commit message (Expand)Author
2019-10-23Track channels and sync ISUPPORTJune McEnroe
2019-10-23Track nick changesJune McEnroe
2019-10-23Rename Command to MessageJune McEnroe
2019-10-23Synchronize state after client registrationJune McEnroe
2019-10-23Send to server if client has no needsJune McEnroe
2019-10-23Implement some amount of client connectionJune McEnroe
2019-10-23Set clients non-blockingJune McEnroe
2019-10-23Clean up state.c and factor out parsingJune McEnroe
2019-10-23Respond to pingsJune McEnroe
2019-10-23Add verbose flagJune McEnroe
2019-10-23Set NOSIGPIPE on server connectionJune McEnroe
2019-10-23Set an initial loop capJune McEnroe
2019-10-23Fix rest parsingJune McEnroe
2019-10-23Add dynamic poll listJune McEnroe
2019-10-23Don't assume commands have targets and handle ERRORJune McEnroe
2019-10-23Clean up state somewhatJune McEnroe
2019-10-23Actually send the buffer...June McEnroe
2019-10-23Add stateJune McEnroe