Commit 1abc4045 by John Kessenich

Add #line functionality to allow expressions instead of just literals. Also…

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
parent b06c378c
......@@ -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!
......
......@@ -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
\ No newline at end of file
......@@ -244,7 +244,7 @@ protected:
int CPPundef(TPpToken * ppToken);
int CPPelse(int matchelse, TPpToken * ppToken);
int extraTokenCheck(int atom, TPpToken* ppToken, int token);
int eval(int token, int prec, int *res, int *err, TPpToken * ppToken);
int eval(int token, int precedence, int& res, bool& err, TPpToken * ppToken);
int CPPif (TPpToken * ppToken);
int CPPifdef(int defined, TPpToken * ppToken);
int CPPline(TPpToken * ppToken);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment