File tree 1 file changed +23
-20
lines changed
1 file changed +23
-20
lines changed Original file line number Diff line number Diff line change @@ -34,28 +34,31 @@ static char const *delim = " \f\n\r\t\v"; // Whitespace according to the C and P
34
34
35
35
static int
36
36
nextLine (std::vector<char > &lineBuf, uint32_t &lineNo, FileStackNode const &where, FILE *file) {
37
- retry:
38
- ++lineNo;
39
- int firstChar = getc (file);
40
- lineBuf.clear ();
37
+ int firstChar;
38
+ for (;;) {
39
+ ++lineNo;
40
+ firstChar = getc (file);
41
+ lineBuf.clear ();
41
42
42
- switch (firstChar) {
43
- case EOF:
44
- return EOF;
45
- case ' ;' :
46
- // Discard comment line
47
- // TODO: if `;!FILE [...]` on the first line (`lineNo`), return it
48
- do {
49
- firstChar = getc (file);
50
- } while (firstChar != EOF && firstChar != ' \r ' && firstChar != ' \n ' );
51
- [[fallthrough]];
52
- case ' \r ' :
53
- if (firstChar == ' \r ' && getc (file) != ' \n ' ) {
54
- consumeLF (where, lineNo, file);
43
+ switch (firstChar) {
44
+ case EOF:
45
+ return EOF;
46
+ case ' ;' :
47
+ // Discard comment line
48
+ // TODO: if `;!FILE [...]` on the first line (`lineNo`), return it
49
+ do {
50
+ firstChar = getc (file);
51
+ } while (firstChar != EOF && firstChar != ' \r ' && firstChar != ' \n ' );
52
+ [[fallthrough]];
53
+ case ' \r ' :
54
+ if (firstChar == ' \r ' && getc (file) != ' \n ' ) {
55
+ consumeLF (where, lineNo, file);
56
+ }
57
+ [[fallthrough]];
58
+ case ' \n ' :
59
+ continue ;
55
60
}
56
- [[fallthrough]];
57
- case ' \n ' :
58
- goto retry;
61
+ break ;
59
62
}
60
63
61
64
for (;;) {
You can’t perform that action at this time.
0 commit comments