mirror of
https://github.com/RevCurtisP/C02.git
synced 2024-11-25 06:31:25 +00:00
Added #pragma ascii mask
This commit is contained in:
parent
cac831bf5d
commit
e92f6823cc
1
c02.c
1
c02.c
@ -45,6 +45,7 @@ void init()
|
||||
vrwrtn = FALSE;
|
||||
zpaddr = 0;
|
||||
invasc = FALSE;
|
||||
mskasc = FALSE;
|
||||
fcase = FALSE;
|
||||
}
|
||||
|
||||
|
@ -75,9 +75,10 @@ void pdefin()
|
||||
void pascii()
|
||||
{
|
||||
getwrd(); //Get Pragma Subdirective
|
||||
if (wordis("INVERT")) {
|
||||
if (wordis("INVERT"))
|
||||
invasc = TRUE;
|
||||
}
|
||||
if (wordis("MASK"))
|
||||
mskasc = TRUE;
|
||||
else {
|
||||
fprintf(stderr, "Unrecognized option '%s'\n", word);
|
||||
exterr(EXIT_FAILURE);
|
||||
|
2
parse.c
2
parse.c
@ -36,6 +36,7 @@ int isxpre() {return TF(isvpre() || match('-'));}
|
||||
|
||||
/* Conversion Functions */
|
||||
char invchr(char c) {return isalpha(c)?(islower(c)?toupper(c):tolower(c)):c;}
|
||||
char mskchr(char c) {return c | 0x80;}
|
||||
|
||||
/* if Word is s then return TRUE else return FALSE*/
|
||||
int wordis(char *s)
|
||||
@ -268,6 +269,7 @@ int prschr()
|
||||
c = getnxt();
|
||||
DEBUG("Extracted character %c\n", c);
|
||||
if (invasc) c = invchr(c);
|
||||
if (mskasc) c = mskchr(c);
|
||||
word[wrdlen++] = c;
|
||||
expect('\'');
|
||||
word[wrdlen++] = '\'';
|
||||
|
Loading…
Reference in New Issue
Block a user