commit 0fbbdab

uint  ·  2026-10-23 21:45:32 +0000 UTC
parent e58ae03
Replace p->pos++ with advance(p)
1 files changed,  +5, -5
M expl.c
M expl.c
+5, -5
 1@@ -37,7 +37,7 @@ atom(parser* p)
 2 	       !current_char(p, ';') &&
 3 	       !current_char(p, '\0') &&
 4 	       !isspace((unsigned char)p->src[p->pos]))
 5-		p->pos++;
 6+		advance(p);
 7 	
 8 	if (start == p->pos) {
 9 		p->err = EXPL_ERR_EXPECTED_ATOM;
10@@ -142,8 +142,8 @@ string(parser* p)
11 
12 	while (!current_char(p, '"') && !current_char(p, '\0')) {
13 		if (current_char(p, '\\') && p->src[p->pos + 1])
14-			p->pos++;
15-		p->pos++;
16+			advance(p);
17+		advance(p);
18 	}
19 
20 	if (current_char(p, '\0')) {
21@@ -175,12 +175,12 @@ skipspace(parser* p)
22 		/* comment */
23 		if (current_char(p, ';')) {
24 			while (!current_char(p, '\n') && !current_char(p, '\0'))
25-				p->pos++;
26+				advance(p);
27 		}
28 
29 		/* whitespace */
30 		else
31-			p->pos++;
32+			advance(p);
33 	}
34 }
35