File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
src/main/kotlin/com/github/lppedd/cc/parser Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -34,12 +34,12 @@ package com.github.lppedd.cc.parser;
3434 int pushback = 0 ;
3535
3636 // Push back trailing whitespace
37- for (; i >= 0 && Character . isWhitespace(yycharat(i)); i-- , pushback++ );
37+ for (; i >= 0 && isWhitespace(yycharat(i)); i-- , pushback++ );
3838
3939 // Check whether we now have a trailing '#'
4040 while (i >= 0 && yycharat(i) == ' #' ) {
4141 // If '#' is attached (e.g., 'Something#'), keep it as part of the type and stop
42- if (i - 1 >= 0 && ! Character . isWhitespace(yycharat(i - 1 ))) {
42+ if (i - 1 >= 0 && ! isWhitespace(yycharat(i - 1 ))) {
4343 break ;
4444 }
4545
@@ -48,12 +48,16 @@ package com.github.lppedd.cc.parser;
4848 pushback++ ;
4949
5050 // Push back any whitespace before the '#' we have just encountered
51- for (; i >= 0 && Character . isWhitespace(yycharat(i)); i-- , pushback++ );
51+ for (; i >= 0 && isWhitespace(yycharat(i)); i-- , pushback++ );
5252 }
5353
5454 return pushback;
5555 }
5656
57+ private boolean isWhitespace(final char ch) {
58+ return Character . isWhitespace(ch) || Character . isSpaceChar(ch);
59+ }
60+
5761 private CCToken token(final CCToken . Type type) {
5862 return token(type, yytext());
5963 }
You can’t perform that action at this time.
0 commit comments