2 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
3 * See the copyright notice in the ACK home directory, in the file "Copyright".
5 /* $Id: skip.c,v 1.6 1994/06/24 10:19:03 ceriel Exp $ */
6 /* PREPROCESSOR: INPUT SKIP FUNCTIONS */
13 skipspaces(ch, skipnl)
16 /* skipspaces() skips any white space and returns the first
19 register int nlseen = 0;
22 while (class(ch) == STSKIP) {
26 if (skipnl && class(ch) == STNL) {
32 /* How about "\\\n"????????? */
44 else if (nlseen && ch == '#') {
47 /* ch is the first character of a line. This means
48 * that nlseen will still be true.
57 /* skipline() skips all characters until a newline character
58 is seen, not escaped by a '\\'.
59 Any comment is skipped.
64 while (class(c) != STNL && c != EOI) {
65 if (class(c) == STSTR || class(c) == STCHAR) {
66 register int stopc = c;
71 if (class(c) == STNL || c == EOI) {
81 } while (escaped || c != stopc);
82 if (class(c) != STNL && c != EOI) {
102 if (c == EOI) { /* garbage input... */
103 error("unexpected EOF while skipping text");