(uxnasm) Increment line value at pointer
This commit is contained in:
parent
03caf9317b
commit
aafef20ba5
|
@ -18,6 +18,7 @@
|
||||||
POP2
|
POP2
|
||||||
|
|
||||||
#010f DEO
|
#010f DEO
|
||||||
|
@1234
|
||||||
|
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ static char *push(char *s, char c) { char *o = dictnext; while((*dictnext++ = *s
|
||||||
#define findlabel(x) finditem(x, labels, label_len)
|
#define findlabel(x) finditem(x, labels, label_len)
|
||||||
#define findmacro(x) finditem(x, macros, macro_len)
|
#define findmacro(x) finditem(x, macros, macro_len)
|
||||||
#define error_top(name, msg) !fprintf(stderr, "%s: %s\n", name, msg)
|
#define error_top(name, msg) !fprintf(stderr, "%s: %s\n", name, msg)
|
||||||
#define error_asm(name) !fprintf(stderr, "%s: %s in @%s, %s:%d.\n", name, token, scope, source, ln)
|
#define error_asm(name) !fprintf(stderr, "%s: %s in @%s, %s:%d.\n", name, token, scope, source, *ln)
|
||||||
|
|
||||||
/* clang-format on */
|
/* clang-format on */
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ walkcomment(FILE *f, int *ln)
|
||||||
char c;
|
char c;
|
||||||
int depth = 1;
|
int depth = 1;
|
||||||
while(f && fread(&c, 1, 1, f)) {
|
while(f && fread(&c, 1, 1, f)) {
|
||||||
if(c == 0xa) ln++;
|
if(c == 0xa) *ln++;
|
||||||
if(c == '(') depth++;
|
if(c == '(') depth++;
|
||||||
if(c == ')' && --depth < 1) return 1;
|
if(c == ')' && --depth < 1) return 1;
|
||||||
}
|
}
|
||||||
|
@ -160,9 +160,9 @@ makemacro(char *name, FILE *f, int *ln)
|
||||||
m->name = push(name, 0);
|
m->name = push(name, 0);
|
||||||
m->content = dictnext;
|
m->content = dictnext;
|
||||||
while(f && fread(&c, 1, 1, f) && c != '{')
|
while(f && fread(&c, 1, 1, f) && c != '{')
|
||||||
if(c == 0xa) ln++;
|
if(c == 0xa) *ln++;
|
||||||
while(f && fread(&c, 1, 1, f) && c != '}') {
|
while(f && fread(&c, 1, 1, f) && c != '}') {
|
||||||
if(c == 0xa) ln++;
|
if(c == 0xa) *ln++;
|
||||||
if(c == '%') return 0;
|
if(c == '%') return 0;
|
||||||
if(c == '(') walkcomment(f, ln);
|
if(c == '(') walkcomment(f, ln);
|
||||||
*dictnext++ = c;
|
*dictnext++ = c;
|
||||||
|
|
Loading…
Reference in New Issue