stage1 人工重构ast.c
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* spl_lexer.c — SPL lexical analyzer */
|
||||
/* spl_lexer.c - SPL lexical analyzer */
|
||||
|
||||
#include "spl_lexer.h"
|
||||
#include "spl_tok.h"
|
||||
@@ -21,7 +21,7 @@ static spl_tok_type_t keyword_type(const char *ident, usize len) {
|
||||
return TOK_IDENT;
|
||||
}
|
||||
|
||||
/* Escape sequence decoder — returns the decoded character,
|
||||
/* Escape sequence decoder - returns the decoded character,
|
||||
* advances *s past the escape sequence, returns 0 on success,
|
||||
* non-zero on error. */
|
||||
int spl_decode_escape(const char **s, char *out) {
|
||||
@@ -85,7 +85,7 @@ spl_tok_vec_t spl_lex(const char *source, const char *fname) {
|
||||
const char *start = source + offset;
|
||||
char c = *start;
|
||||
|
||||
/* Skip whitespace (but not newlines — emit TOK_ENDLINE) */
|
||||
/* Skip whitespace (but not newlines - emit TOK_ENDLINE) */
|
||||
if (c == ' ' || c == '\t' || c == '\r') {
|
||||
offset++;
|
||||
col++;
|
||||
|
||||
Reference in New Issue
Block a user