Skip to content

Commit

Permalink
allow '@' as local label indicator for ca65 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
freem committed Mar 3, 2016
1 parent 816456a commit c98d89e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions assemble.c
Expand Up @@ -154,8 +154,8 @@ assemble(void)
c = prlnbuf[i + j];
if (isdigit(c) && (j == 0))
break;
if (!isalnum(c) && (c != '_') && (c != '.'))
{ if((local_check=='.') && ((c=='-') || (c=='+')))
if (!isalnum(c) && (c != '_') && (c != '.') && (c != '@'))
{ if((local_check=='.' || local_check=='@') && ((c=='-') || (c=='+')))
{ }
else { break;}
}
Expand Down Expand Up @@ -278,7 +278,7 @@ oplook(int *idx)
c = toupper(prlnbuf[*idx]);
if (c == ' ' || c == '\t' || c == '\0' || c == ';')
break;
if (!isalnum(c) && c != '.' && c != '*' && c != '=')
if (!isalnum(c) && c != '.' && c != '@' && c != '*' && c != '=')
return (-1);
if (i == 15)
return (-1);
Expand Down
8 changes: 4 additions & 4 deletions expr.c
Expand Up @@ -100,7 +100,7 @@ evaluate(int *ip, char last_char)

/* symbol */
else
if (isalpha(c) || c == '_' || c == '.') {
if (isalpha(c) || c == '_' || c == '.' || c == '@') {
if (need_operator)
goto error;
if (!push_val(T_SYMBOL))
Expand Down Expand Up @@ -540,7 +540,7 @@ getsym(void)
local_check = *expr;
while (valid) {
c = *expr;
if (isalpha(c) || c == '_' || c == '.' || (isdigit(c) && i >= 1)) {
if (isalpha(c) || c == '_' || c == '.' || c == '@' || (isdigit(c) && i >= 1)) {
symbol[++i] = c;
expr++;
}
Expand Down Expand Up @@ -599,12 +599,12 @@ getsym_op(void)
local_check = *expr;
while (valid) {
c = *expr;
if (isalpha(c) || c == '_' || c == '.' || (isdigit(c) && i >= 1)) {
if (isalpha(c) || c == '_' || c == '.' || c == '@' || (isdigit(c) && i >= 1)) {
if (i < SBOLSZ - 1)
symbol[++i] = c;
expr++;
}
else if((local_check=='.') && ((c=='-') || (c=='+'))) {
else if((local_check=='.' || local_check=='@') && ((c=='-') || (c=='+'))) {
if (i < SBOLSZ - 1)
symbol[++i] = c;
expr++;
Expand Down
2 changes: 1 addition & 1 deletion macro.c
Expand Up @@ -405,7 +405,7 @@ macro_getargtype(char *arg)
c = arg[i];
if (isdigit(c) && (i == 0))
break;
if ((!isalnum(c)) && (c != '_') && (c != '.'))
if ((!isalnum(c)) && (c != '_') && (c != '.') && (c != '@'))
break;
}

Expand Down
2 changes: 1 addition & 1 deletion proc.c
Expand Up @@ -172,7 +172,7 @@ do_proc(int *ip)
}

/* check symbol */
if (symbol[1] == '.') {
if (symbol[1] == '.' || symbol[1] == '@') {
fatal_error("Proc/group name can not be local!");
return;
}
Expand Down
8 changes: 4 additions & 4 deletions symbol.c
Expand Up @@ -54,8 +54,8 @@ colsym(int *ip)
c = prlnbuf[*ip];
if (isdigit(c) && (i == 0))
break;
if (!isalnum(c) && (c != '_') && (c != '.'))
{ if((local_check=='.') && ((c=='-') || (c=='+')))
if (!isalnum(c) && (c != '_') && (c != '.') && (c != '@'))
{ if((local_check=='.' || local_check=='@') && ((c=='-') || (c=='+')))
{ }
else { break;}
}
Expand Down Expand Up @@ -108,7 +108,7 @@ struct t_symbol *stlook(int flag)
int hash;

/* local symbol */
if (symbol[1] == '.') {
if (symbol[1] == '.' || symbol[1] == '@') {
if (glablptr) {
/* search the symbol in the local list */
sym = glablptr->local;
Expand Down Expand Up @@ -300,7 +300,7 @@ labldef(int lval, int flag)

/* check if it's a local or global symbol */
c = lablptr->name[1];
if (c == '.')
if (c == '.' || c == '@')
/* local */
lastlabl = NULL;
else {
Expand Down

0 comments on commit c98d89e

Please sign in to comment.