add support for \<, \>, and \^ to qfcc. \< bolds all characters (toggles bold really) until \>, and \^ bolds (toggles) the next character.

This commit is contained in:
Adam Olsen 2001-06-19 23:27:07 +00:00
parent 20bf698330
commit 67e4fa85bf

View file

@ -159,8 +159,13 @@ PR_LexString (void)
int c;
int len;
int i;
int mask;
int boldnext;
len = 0;
mask = 0x00;
boldnext = 0;
pr_file_p++;
do {
c = *pr_file_p++;
@ -232,6 +237,17 @@ PR_LexString (void)
case 'v':
c = '\v';
break;
case '^':
if (*pr_file_p == '\"')
PR_ParseError ("Unexpected end of string after \\^");
boldnext = 1;
continue;
case '<':
mask = 0x80;
continue;
case '>':
mask = 0x00;
continue;
default:
PR_ParseError ("Unknown escape char");
break;
@ -243,6 +259,10 @@ PR_LexString (void)
strcpy (pr_immediate_string, pr_token);
return;
}
if (boldnext)
c = c ^ 0x80;
boldnext = 0;
c = c ^ mask;
pr_token[len] = c;
len++;
} while (1);