mojoshader_lexer.re
changeset 1121 4142681f9fda
parent 959 8a5d46db0cc6
child 1123 3d842e7dd6ad
equal deleted inserted replaced
1120:f655ea9c8ecd 1121:4142681f9fda
   167     if (YYLIMIT == YYCURSOR) YYFILL(1);
   167     if (YYLIMIT == YYCURSOR) YYFILL(1);
   168     matchptr = cursor;
   168     matchptr = cursor;
   169 // The "*\/" is just to avoid screwing up text editor syntax highlighting.
   169 // The "*\/" is just to avoid screwing up text editor syntax highlighting.
   170 /*!re2c
   170 /*!re2c
   171     "*\/"           {
   171     "*\/"           {
   172                         if (saw_newline)
   172                         if (s->report_comments)
       
   173                             RET(TOKEN_MULTI_COMMENT);
       
   174                         else if (saw_newline)
   173                             RET('\n');
   175                             RET('\n');
   174                         else if (s->report_whitespace)
   176                         else if (s->report_whitespace)
   175                             RET(' ');
   177                             RET(' ');
   176                         goto scanner_loop;
   178                         goto scanner_loop;
   177                     }
   179                     }
   191 
   193 
   192 singlelinecomment:
   194 singlelinecomment:
   193     if (YYLIMIT == YYCURSOR) YYFILL(1);
   195     if (YYLIMIT == YYCURSOR) YYFILL(1);
   194     matchptr = cursor;
   196     matchptr = cursor;
   195 /*!re2c
   197 /*!re2c
   196     NEWLINE         { s->line++; token = matchptr; RET('\n'); }
   198     NEWLINE         {
   197     "\000"          { if (eoi) { RET(TOKEN_EOI); } goto singlelinecomment; }
   199                         s->line++;
       
   200                         if (s->report_comments)
       
   201                             RET(TOKEN_SINGLE_COMMENT);
       
   202                         token = matchptr;
       
   203                         RET('\n');
       
   204                     }
       
   205     "\000"          {
       
   206                         if (eoi)
       
   207                         {
       
   208                             if (s->report_comments)
       
   209                                 RET(TOKEN_SINGLE_COMMENT);
       
   210                             else
       
   211                                 RET(TOKEN_EOI);
       
   212                         }
       
   213                         goto singlelinecomment;
       
   214                     }
   198     ANY             { goto singlelinecomment; }
   215     ANY             { goto singlelinecomment; }
   199 */
   216 */
   200 
   217 
   201 ppdirective:
   218 ppdirective:
   202     if (YYLIMIT == YYCURSOR) YYFILL(1);
   219     if (YYLIMIT == YYCURSOR) YYFILL(1);