mojoshader_assembler.c
changeset 550 2f977a75d2b5
parent 549 13714d3b3fa2
child 551 217200672d64
equal deleted inserted replaced
549:13714d3b3fa2 550:2f977a75d2b5
    98 {
    98 {
    99     const char *fname = NULL;
    99     const char *fname = NULL;
   100     unsigned int linenum = 0;
   100     unsigned int linenum = 0;
   101     int error_position = 0;
   101     int error_position = 0;
   102 
   102 
       
   103     ctx->isfail = 1;
       
   104 
   103     switch (ctx->parse_phase)
   105     switch (ctx->parse_phase)
   104     {
   106     {
   105         case MOJOSHADER_PARSEPHASE_NOTSTARTED:
   107         case MOJOSHADER_PARSEPHASE_NOTSTARTED:
   106             error_position = -2;
   108             error_position = -2;
   107             break;
   109             break;
  2004     // Version token always comes first.
  2006     // Version token always comes first.
  2005     ctx->parse_phase = MOJOSHADER_PARSEPHASE_WORKING;
  2007     ctx->parse_phase = MOJOSHADER_PARSEPHASE_WORKING;
  2006     parse_version_token(ctx);
  2008     parse_version_token(ctx);
  2007     output_comments(ctx, comments, comment_count, symbols, symbol_count);
  2009     output_comments(ctx, comments, comment_count, symbols, symbol_count);
  2008 
  2010 
       
  2011     if (isfail(ctx))
       
  2012     {
       
  2013         failed = 1;
       
  2014         ctx->isfail = 0;
       
  2015         skip_line(ctx);  // start fresh on next line.
       
  2016     } // if
       
  2017 
  2009     // parse out the rest of the tokens after the version token...
  2018     // parse out the rest of the tokens after the version token...
  2010     while ((nexttoken(ctx, 1, 1, 0, 1)) && (!ctx->eof))
  2019     while ((nexttoken(ctx, 1, 1, 0, 1)) && (!ctx->eof))
  2011     {
  2020     {
       
  2021         parse_token(ctx);
  2012         if (isfail(ctx))
  2022         if (isfail(ctx))
  2013         {
  2023         {
  2014             failed = 1;
  2024             failed = 1;
  2015             ctx->isfail = 0;
  2025             ctx->isfail = 0;
  2016             skip_line(ctx);  // start fresh on next line.
  2026             skip_line(ctx);  // start fresh on next line.
  2017         } // if
  2027         } // if
  2018         parse_token(ctx);
       
  2019     } // while
  2028     } // while
  2020 
  2029 
  2021     ctx->isfail = failed;
  2030     ctx->isfail = failed;
  2022 
  2031 
  2023     output_token(ctx, 0x0000FFFF);   // end token always 0x0000FFFF.
  2032     output_token(ctx, 0x0000FFFF);   // end token always 0x0000FFFF.