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 3.8 1994/06/24 12:05:55 ceriel Exp $ */
6 /* PREPROCESSOR: INPUT SKIP FUNCTIONS */
13 #include "interface.h"
17 skipspaces(ch, skipnl)
20 /* skipspaces() skips any white space and returns the first
23 register int nlseen = 0;
26 while (class(ch) == STSKIP) {
30 if (skipnl && class(ch) == STNL) {
36 /* How about "\\\n"????????? */
49 else if (nlseen && ch == '#') {
52 /* ch is the first character of a line. This means
53 * that nlseen will still be true.
63 /* skipline() skips all characters until a newline character
64 is seen, not escaped by a '\\'.
65 Any comment is skipped.
70 while (class(c) != STNL && c != EOI) {
71 if (class(c) == STSTR || class(c) == STCHAR) {
72 register int stopc = c;
77 if (class(c) == STNL || c == EOI) {
87 } while (escaped || c != stopc);
88 if (class(c) != STNL && c != EOI) {
109 if (c == EOI) { /* garbage input... */
110 lexerror("unexpected EOF while skipping text");