print3("memb = ", ftos(pawn.memb), "\n");
pawn.memb += -1;
print3("memb = ", ftos(pawn.memb), "\n");
- print3("Frame stand3 is ", ftos(stand3), " wooh\n");
+ print3("Frame stand3 is ", ftos($stand3), " wooh\n");
};
/* modelgen / spiritgen commands */
if (ch == '$') {
const char *v;
+ size_t frame;
+
ch = lex_getch(lex);
if (!isident_start(ch)) {
lexerror(lex, "hanging '$' modelgen/spritegen command line");
ch = lex_getch(lex);
return lex_do(lex);
}
+
+ for (frame = 0; frame < lex->frames_count; ++frame) {
+ if (!strcmp(v, lex->frames[frame].name)) {
+ lex->tok->constval.i = lex->frames[frame].value;
+ return (lex->tok->ttype = TOKEN_INTCONST);
+ }
+ }
+
+ lexerror(lex, "invalid frame macro");
+ return lex_do(lex);
}
/* single-character tokens */
if (isident_start(ch))
{
const char *v;
- size_t frame;
+
if (!lex_tokench(lex, ch))
return (lex->tok->ttype = TOKEN_FATAL);
if (!lex_finish_ident(lex)) {
!strcmp(v, "const"))
lex->tok->ttype = TOKEN_KEYWORD;
- for (frame = 0; frame < lex->frames_count; ++frame) {
- if (!strcmp(v, lex->frames[frame].name)) {
- lex->tok->constval.i = lex->frames[frame].value;
- return (lex->tok->ttype = TOKEN_INTCONST);
- }
- }
-
return lex->tok->ttype;
}