mojoshader_preprocessor.c
changeset 1122 b333c15bb984
parent 1121 4142681f9fda
child 1126 91c22d2de774
equal deleted inserted replaced
1121:4142681f9fda 1122:b333c15bb984
   544             put_include(ctx, state);
   544             put_include(ctx, state);
   545             return 0;
   545             return 0;
   546         } // if
   546         } // if
   547     } // if
   547     } // if
   548 
   548 
   549     #if !MATCH_MICROSOFT_PREPROCESSOR
       
   550     state->report_comments = 1;
       
   551     #endif
       
   552 
       
   553     state->close_callback = close_callback;
   549     state->close_callback = close_callback;
   554     state->source_base = source;
   550     state->source_base = source;
   555     state->source = source;
   551     state->source = source;
   556     state->token = source;
   552     state->token = source;
   557     state->tokenval = ((Token) '\n');
   553     state->tokenval = ((Token) '\n');
   730 } // pushback
   726 } // pushback
   731 
   727 
   732 
   728 
   733 static Token lexer(IncludeState *state)
   729 static Token lexer(IncludeState *state)
   734 {
   730 {
   735     #if !MATCH_MICROSOFT_PREPROCESSOR
       
   736     state->report_whitespace = 1;
       
   737     #endif
       
   738 
       
   739     if (!state->pushedback)
   731     if (!state->pushedback)
   740         return preprocessor_lexer(state);
   732         return preprocessor_lexer(state);
   741     state->pushedback = 0;
   733     state->pushedback = 0;
   742     return state->tokenval;
   734     return state->tokenval;
   743 } // lexer
   735 } // lexer
  2020         } // if
  2012         } // if
  2021 
  2013 
  2022         const Conditional *cond = state->conditional_stack;
  2014         const Conditional *cond = state->conditional_stack;
  2023         const int skipping = ((cond != NULL) && (cond->skipping));
  2015         const int skipping = ((cond != NULL) && (cond->skipping));
  2024 
  2016 
       
  2017         #if !MATCH_MICROSOFT_PREPROCESSOR
       
  2018         state->report_whitespace = 1;
       
  2019         state->report_comments = 1;
       
  2020         #endif
       
  2021 
  2025         const Token token = lexer(state);
  2022         const Token token = lexer(state);
       
  2023 
       
  2024         #if !MATCH_MICROSOFT_PREPROCESSOR
       
  2025         state->report_whitespace = 0;
       
  2026         state->report_comments = 0;
       
  2027         #endif
  2026 
  2028 
  2027         if (token != TOKEN_IDENTIFIER)
  2029         if (token != TOKEN_IDENTIFIER)
  2028             ctx->recursion_count = 0;
  2030             ctx->recursion_count = 0;
  2029 
  2031 
  2030         if (token == TOKEN_EOI)
  2032         if (token == TOKEN_EOI)