return tk;
}
prev = ch;
- if (prev == '/')
- save_unget_state(state);
+ save_unget_state(state);
ch = get_char(state);
if (!(ignored && (1<<TK_string)) && is_quote(ch))
break;
- if (!(ignored && (1<<TK_line_comment)) &&
- prev == '/' && ch == '/') {
+ if (prev == '#')
+ break;
+ if (prev == '/' && ch == '/' && tk.txt.len > 1) {
restore_unget_state(state);
break;
}
- if (!(ignored && (1<<TK_block_comment)) &&
- prev == '/' && ch == '*') {
+ if (prev == '/' && ch == '*' && tk.txt.len > 1) {
restore_unget_state(state);
break;
}
}
unget_char(state);
- if (tk.num != TK_error)
+ if (tk.num != TK_error) {
+ close_token(state, &tk);
return tk;
+ }
###### unknown mark
if (tk.txt.len) {
These two comment types are reported as two separate token types, and
consequently can be ignored separately. When ignored a comment is
-parsed and discarded.
+still parsed, but is discarded.
###### token types
TK_line_comment,