Skip to content

Commit

Permalink
skip initial whitespace instead of consuming it (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
tek committed Nov 14, 2021
1 parent 6668085 commit d72f2e4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/scanner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1044,11 +1044,11 @@ using namespace parser;
uint32_t count_indent(State & state) {
uint32_t indent = 0;
for (;;) {
if (cond::consumes(cond::newline)(state)) {
if (cond::skips(cond::newline)(state)) {
indent = 0;
} else if (cond::consume(' ')(state)) {
} else if (cond::skip(' ')(state)) {
indent++;
} else if (cond::consume('\t')(state)) {
} else if (cond::skip('\t')(state)) {
indent += 8;
} else break;
}
Expand Down

0 comments on commit d72f2e4

Please sign in to comment.