Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed error reporting in assembler.
  • Loading branch information
icculus committed Feb 3, 2009
1 parent 7a19260 commit 7f6d425
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion mojoshader_assembler.c
Expand Up @@ -100,6 +100,8 @@ static void failf(Context *ctx, const char *fmt, ...)
unsigned int linenum = 0;
int error_position = 0;

ctx->isfail = 1;

switch (ctx->parse_phase)
{
case MOJOSHADER_PARSEPHASE_NOTSTARTED:
Expand Down Expand Up @@ -2006,16 +2008,23 @@ const MOJOSHADER_parseData *MOJOSHADER_assemble(const char *source,
parse_version_token(ctx);
output_comments(ctx, comments, comment_count, symbols, symbol_count);

if (isfail(ctx))
{
failed = 1;
ctx->isfail = 0;
skip_line(ctx); // start fresh on next line.
} // if

// parse out the rest of the tokens after the version token...
while ((nexttoken(ctx, 1, 1, 0, 1)) && (!ctx->eof))
{
parse_token(ctx);
if (isfail(ctx))
{
failed = 1;
ctx->isfail = 0;
skip_line(ctx); // start fresh on next line.
} // if
parse_token(ctx);
} // while

ctx->isfail = failed;
Expand Down

0 comments on commit 7f6d425

Please sign in to comment.