Add #line functionality to allow expressions instead of just literals. Also made some preprocessor code slightly more clear.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24294 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2013-12-03 17:19:03 +00:00
parent b06c378cc9
commit 1abc4045ce
4 changed files with 101 additions and 59 deletions

View file

@ -61,8 +61,17 @@ ERROR: 0:235: 'line continuation' : not supported for this version or the enable
ERROR: 0:236: '#error' : good continuation
ERROR: 0:238: '#' : invalid directive: flizbit
ERROR: 0:242: '#' : invalid directive: directive
ERROR: 0:246: '' : missing #endif
ERROR: 62 compilation errors. No code generated.
ERROR: 0:12001: '#error' : line should be 12001
ERROR: 7:13001: '#error' : line should be 13001 , string 7
ERROR: 7:14014: '#error' : line should be 14014 , string 7
ERROR: 12:14014: '#error' : line should be 14014 , string 12
ERROR: 12:14026: '#error' : line should be 14026 , string 12
ERROR: 12:1234: '#line' : unexpected tokens following directive
ERROR: 12:20001: '#error' : line should be 20001
ERROR: 12:20011: '#error' : line should be 20011
ERROR: 12:20021: '#error' : line should be 20021
ERROR: 12:10003: '' : missing #endif
ERROR: 71 compilation errors. No code generated.
ERROR: node is still EOpNull!

View file

@ -241,6 +241,29 @@ double f = f1;
#directive directive was expanded
#line 12000
#error line should be 12001
#line 13000 7
#error line should be 13001, string 7
#define L1 14000
#define L2 13
#define F1 5
#define F2 7
#line L1 + L2
#error line should be 14014, string 7
#line L1 + L2 F1 + F2
#error line should be 14014, string 12
#line L1 + L2 + F1 + F2
#error line should be 14026, string 12
#line 1234 F1 + F2 extra
#line (20000)
#error line should be 20001
#line (20000+10)
#error line should be 20011
#line +20020
#error line should be 20021
#line 10000
#if 1
#else
// ERROR, missing #endif