Skip to content

Commit ddcb46e

Browse files
committed
Fix parsing of multi-line comments
The "comment end" token was not being identified if it wasn't at the beginning of a new line.
1 parent 39abe9c commit ddcb46e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

parse.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,8 @@ struct Token token_get(char *code, char **next) {
165165
// Scan for the ending directive token
166166
char *comment_end;
167167
while (true) {
168-
code += scan_string(code, char_is_not_eol) + 1;
168+
while (*++code != '\0') if (*code == CHR_DIRECTIVE) break;
169169
if (*code == '\0') break;
170-
if (*code != CHR_DIRECTIVE) continue;
171170

172171
bool match_short, match_long = false, match = false;
173172
++code;

0 commit comments

Comments
 (0)