浏览代码

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

legacy
Sam Hocevar sam 12 年前
父节点
当前提交
e7fd8c57e2
共有 3 个文件被更改,包括 749 次插入250 次删除
  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 查看文件

@@ -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
文件差异内容过多而无法显示
查看文件


+ 5
- 5
test/sandbox/lex/test.lolfx 查看文件

@@ -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)
{


正在加载...
取消
保存