Sfoglia il codice sorgente

test: a better GLSL parser in the LolFx test parser.

legacy
Sam Hocevar sam 12 anni fa
parent
commit
e7fd8c57e2
3 ha cambiato i file con 749 aggiunte e 250 eliminazioni
  1. +14
    -1
      test/sandbox/lex/lolfx.l
  2. +730
    -244
      test/sandbox/lex/lolfx.y
  3. +5
    -5
      test/sandbox/lex/test.lolfx

+ 14
- 1
test/sandbox/lex/lolfx.l Vedi File

@@ -62,6 +62,12 @@
"precision" { return GT_PRECISION; }
"invariant" { return GT_INVARIANT; }

/*
* Deprecated GLSL keywords
*/

"attribute" { return GT_ATTRIBUTE; }

/*
* GLSL vector types
*/
@@ -433,11 +439,18 @@
"#"[ \t]*"pragma" { return PREPROCESSOR_PRAGMA; }
"#"[ \t]*"undef" { return PREPROCESSOR_UNDEF; }

/*
* GLSL preprocessor directives
*/

"#"[ \t]*"version".* { /* ignore for now */ }

/*
* LolFx preprocessor directives
*/

"#"[ \t]*"region" { return PREPROCESSOR_REGION; }
"#"[ \t]*"region" { return PREPROCESSOR_REGION; }
"#"[ \t]*"pragma"[ \t]*"lolfx".* { /* ignore for now */ }

/*
* HLSL reserved keywords


+ 730
- 244
test/sandbox/lex/lolfx.y
File diff soppresso perché troppo grande
Vedi File


+ 5
- 5
test/sandbox/lex/test.lolfx Vedi File

@@ -66,7 +66,7 @@ technique Foo

/* Defines GLSL shader "Prout" */

#section GLSL.Prout
#region GLSL.Prout

#version 120

@@ -80,21 +80,21 @@ attribute vec4 in_Color;

void main(void)
{
...
/* ... */
}

/* Defines GLSL shader "Zob" */

#section GLSL.Zob
#region GLSL.Zob

void main(void)
{
shit fuck fuck shit;
shit(); fuck(); fuck(); shit();
}

/* Defines HLSL shader "Prout" */

#section HLSL.Prout
#region HLSL.Prout

void main(void)
{


Caricamento…
Annulla
Salva