Changeset 1454


Ignore:
Timestamp:
Jun 11, 2012, 11:21:43 PM (8 years ago)
Author:
sam
Message:

test: GLSL syntax fiddling.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/sandbox/lex/lolfx.l

    r1427 r1454  
    55%}
    66
     7%x GLSL
     8%x HLSL
    79%x C_COMMENT
    810%x CPP_COMMENT
    911
    1012%%
     13
     14%{
     15int comment_caller = INITIAL;
     16%}
    1117
    1218 /*
     
    450456  */
    451457
    452 "#"[ \t]*"region"                  { return PREPROCESSOR_REGION; }
     458"#"[ \t]*"region GLSL"       { BEGIN(GLSL); }
     459"#"[ \t]*"region HLSL"       { BEGIN(HLSL); }
    453460"#"[ \t]*"pragma"[ \t]*"lolfx".*   { /* ignore for now */ }
    454461
     
    534541  */
    535542
    536 "/*"              { BEGIN(C_COMMENT); }
    537 <C_COMMENT>"*/"   { BEGIN(INITIAL); }
     543<GLSL>"/*"        { comment_caller = GLSL; BEGIN(C_COMMENT); }
     544<HLSL>"/*"        { comment_caller = HLSL; BEGIN(C_COMMENT); }
     545"/*"              { comment_caller = INITIAL; BEGIN(C_COMMENT); }
     546<C_COMMENT>"*/"   { BEGIN(comment_caller); }
    538547<C_COMMENT>[^*]*  { }
    539548<C_COMMENT>.      { }
     
    543552  */
    544553
    545 "//"              { BEGIN(CPP_COMMENT); }
    546 <CPP_COMMENT>\n   { BEGIN(INITIAL); }
     554<GLSL>"//"        { comment_caller = GLSL; BEGIN(CPP_COMMENT); }
     555<HLSL>"//"        { comment_caller = HLSL; BEGIN(CPP_COMMENT); }
     556"//"              { comment_caller = INITIAL; BEGIN(CPP_COMMENT); }
     557<CPP_COMMENT>\n   { BEGIN(comment_caller); }
    547558<CPP_COMMENT>.*   { }
    548559
Note: See TracChangeset for help on using the changeset viewer.