#define PT_SEMI 0x00000010
#define PT_EQUALS 0x00000020
#define PT_SPACE 0x00000040
+#define PT_GT 0x00000080
/* These represent '\0', '}', ']', ')', ',', ';', '=', and ' ', respectively.
* If the character corresponding to a set flag is encountered, then
if (tflags & PT_SPACE)
goto exit_sequence;
break;
+ case '>':
+ if (tflags & PT_GT)
+ goto exit_sequence;
+ break;
case '\0':
goto exit_sequence;
}
safe_chr(savec, buff, bp);
(*str)++;
switch (savec) {
- case '<':
- savec = **str;
- if (!savec)
- goto exit_sequence;
- for (savec = **str; savec && savec != '>'; savec = **str) {
- safe_chr(savec, buff, bp);
- (*str)++;
- }
- if(!savec)
- goto exit_sequence;
- safe_chr(savec, buff, bp);
- (*str)++;
- break;
+ case '<':
+ process_expression(buff, bp, str, executor, caller, enactor,
+ eflags & ~PE_STRIP_BRACES, PT_GT, pe_info);
+ break;
case 'Q':
case 'q':
savec = **str;
goto exit_sequence;
safe_chr(savec, buff, bp);
(*str)++;
- if (savec == '<') {
- for (savec = **str; savec && savec != '>'; savec = **str) {
- safe_chr(savec, buff, bp);
- (*str)++;
- }
- if(!savec)
- goto exit_sequence;
- safe_chr(savec, buff, bp);
+ if (savec == '<')
+ process_expression(buff, bp, str, executor, caller, enactor,
+ eflags & ~PE_STRIP_BRACES, PT_GT, pe_info);
+ else
(*str)++;
- }
break;
case 'V':
case 'v':
gender = get_gender(enactor);
safe_str(poss[gender], buff, bp);
break;
- case '<':
+ case '<': /* attribute value */
if (!**str)
goto exit_sequence;
- {
- const char *tmp;
+ else {
char atrname[BUFFER_LEN];
+ char *anp = atrname;
ATTR *atr;
- for(tmp = *str; *tmp && *tmp != '>'; tmp++)
- ;
- if(!*tmp || tmp == *str) {
- (*str)--;
- goto exit_sequence;
+ if (process_expression(atrname, &anp, str, executor, caller,
+ enactor, eflags & ~PE_STRIP_BRACES, PT_GT,
+ pe_info)) {
+ retval = 1;
+ break;
}
- strncpy(atrname, *str, tmp - *str);
- atrname[tmp - *str] = '\0';
-
+ *anp = '\0';
atr = atr_get(executor, strupper(atrname));
if(atr)
safe_str(atr_value(atr), buff, bp);
- *str = tmp + 1;
+ if (**str == '>')
+ (*str)++;
}
break;
case 'Q':
goto exit_sequence;
(*str)++;
if (nextc == '<') {
- const char *tmp;
char regname[BUFFER_LEN];
- for(tmp = *str; *tmp && *tmp != '>'; tmp++)
- ;
- if(!*tmp || tmp == *str) {
- (*str)--;
- goto exit_sequence;
+ char *rnp = regname;
+ if (process_expression(regname, &rnp, str, executor, caller,
+ enactor, eflags & ~PE_STRIP_BRACES, PT_GT,
+ pe_info)) {
+ retval = 1;
+ break;
}
- strncpy(regname, *str, tmp - *str);
- regname[tmp - *str] = '\0';
- safe_str(get_namedreg(&global_eval_context.namedregs, regname), buff, bp);
- *str = tmp + 1;
+ *rnp = '\0';
+ safe_str(get_namedreg(&global_eval_context.namedregs, regname),
+ buff, bp);
+ if (**str == '>')
+ (*str)++;
} else {
if ((qindex = qreg_indexes[(unsigned char) nextc]) == -1)
break;
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,