// escape nothing \o oeu
// escape newline \
still in a comment
+// escape newline \
+
+// a different comment
+#version 430 core
+varying vec4 v;
+void main() {}
+
//POSSIBILITY OF SUCH DAMAGE.
//
+#include "float.h"
#include "localintermediate.h"
namespace {
EProfile profile; // the declared profile in the shader (core by default)
bool forwardCompatible; // true if errors are to be given for use of deprecated features
EShMessages messages; // errors/warnings
- bool futureCompatibility; // true if requesting errors for future compatibility (false by default)
TMap<TString, TBehavior> extensionBehavior; // for each extension string, what it's current enablement is
struct TPragma contextPragma;
const char* startPoint = s;
// first, skip white space
- while (*s == ' ' || *s == '\t' || *s == '\n' || *s == '\r') {
+ while (*s == ' ' || *s == '\t' || *s == '\r' || *s == '\n') {
++s;
}
// then, check for a comment
if (*s == '/') {
if (*(s+1) == '/') {
+
+ // a '//' style comment
s += 2;
do {
- while (*s && *s != '\\' && *s != '\n')
+ while (*s && *s != '\\' && *s != '\r' && *s != '\n')
++s;
- if (*s == '\n' || *s == 0) {
- if (*s == '\n') {
+ if (*s == '\r' || *s == '\n' || *s == 0) {
+ while (*s == '\r' || *s == '\n')
++s;
- if (*s == '\r')
- ++s;
- } // else it's 0, end of string
// we reached the end of the comment
break;
} else {
// it's a '\', so we need to keep going, after skipping what's escaped
++s;
- if (*s == '\n') {
- ++s;
- if (*s == '\r')
- ++s;
- } else {
+ if (*s == '\r' && *(s+1) == '\n')
+ s += 2;
+ else {
// skip the escaped character
if (*s)
++s;
}
}
} while (true);
+
} else if (*(s+1) == '*') {
+
+ // a '/*' style comment
s += 2;
do {
while (*s && *s != '*')
// profile
const char* end = s;
- while (*end != ' ' && *end != '\t' && *end != '\n') {
+ while (*end != ' ' && *end != '\t' && *end != '\n' && *end != '\r') {
if (*end == 0)
return;
++end;
#include "ParseHelper.h"
-char* StageName[EShLangCount] = {
+const char* StageName[EShLangCount] = {
"vertex",
"tessellation control",
"tessellation evaluation",
"fragment"
};
-char* ProfileName[EProfileCount] = {
+const char* ProfileName[EProfileCount] = {
"none",
"core",
"compatibility",
return 0;\r
}\r
\r
-void yyerror(char *s)\r
+void yyerror(const char *s)\r
{\r
TParseContext& pc = *((TParseContext *)cpp->pC);\r
\r
\r
pyylval->lex.line = line;\r
pyylval->lex.string = NewPoolTString(text);\r
- if (pc.futureCompatibility && ! (pc.messages & EShMsgSuppressWarnings)) {\r
+ if (pc.forwardCompatible && ! (pc.messages & EShMsgSuppressWarnings)) {\r
pc.infoSink.info.message(EPrefixWarning, pyylval->lex.string->c_str(), yylineno);\r
pc.infoSink.info.message(EPrefixWarning, "using future reserved keyword", yylineno);\r
}\r
pc.profile != EEsProfile && pc.version < version) {\r
pyylval->lex.line = yylineno;\r
pyylval->lex.string = NewPoolTString(yytext);\r
- if (pc.futureCompatibility && ! (pc.messages & EShMsgSuppressWarnings)) {\r
+ if (pc.forwardCompatible && ! (pc.messages & EShMsgSuppressWarnings)) {\r
pc.infoSink.info.message(EPrefixWarning, pyylval->lex.string->c_str(), yylineno);\r
pc.infoSink.info.message(EPrefixWarning, "future reserved word in ES 300 and keyword in GLSL", yylineno);\r
}\r
\r
pyylval->lex.line = line;\r
pyylval->lex.string = NewPoolTString(text);\r
- if (pc.futureCompatibility && ! (pc.messages & EShMsgSuppressWarnings)) {\r
+ if (pc.forwardCompatible && ! (pc.messages & EShMsgSuppressWarnings)) {\r
pc.infoSink.info.message(EPrefixWarning, pyylval->lex.string->c_str(), yylineno);\r
pc.infoSink.info.message(EPrefixWarning, "using ES precision qualifier keyword", yylineno);\r
}\r
\r
pyylval->lex.line = line;\r
pyylval->lex.string = NewPoolTString(text);\r
- if (pc.futureCompatibility && ! (pc.messages & EShMsgSuppressWarnings)) {\r
+ if (pc.forwardCompatible && ! (pc.messages & EShMsgSuppressWarnings)) {\r
pc.infoSink.info.message(EPrefixWarning, pyylval->lex.string->c_str(), yylineno);\r
pc.infoSink.info.message(EPrefixWarning, "using future non-square matrix type keyword", yylineno);\r
}\r
\r
pyylval->lex.line = line;\r
pyylval->lex.string = NewPoolTString(text);\r
- if (pc.futureCompatibility && ! (pc.messages & EShMsgSuppressWarnings)) {\r
+ if (pc.forwardCompatible && ! (pc.messages & EShMsgSuppressWarnings)) {\r
pc.infoSink.info.message(EPrefixWarning, pyylval->lex.string->c_str(), yylineno);\r
pc.infoSink.info.message(EPrefixWarning, "using future type keyword", yylineno);\r
}\r
#define parseContext (*((TParseContext*)(parseContextLocal)))\r
#define YY_DECL int yylex(YYSTYPE* pyylval, void* parseContextLocal)\r
#define YYLEX_PARAM (void*)(parseContextLocal)\r
- extern void yyerror(char*);\r
#endif\r
\r
+extern void yyerror(const char*);\r
+\r
%}\r
\r
%union {\r
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
-
-#ifdef _WIN32
#include <stdint.h>
-#elif defined (_WIN64)
-typedef unsigned __int64 uintptr_t;
-#else
-typedef unsigned int uintptr_t;
-#endif
#include "memory.h"
// This file contains any Linux specific functions.
//
-#if !(defined(linux))
-#error Trying to include a Linux specific file in a non-Linux build.
-#endif
-
#include <pthread.h>
#include <semaphore.h>
#include <assert.h>
#include "osinclude.h"
#include "InitializeDll.h"
-#if !(defined(linux))
-#error Trying to build a Linux specific file in a non-Linux build.
-#endif
-
-
//
// Thread cleanup
//
EShLangFragmentMask = (1 << EShLangFragment),
} EShLanguageMask;
-extern char* StageName[EShLangCount];
+extern const char* StageName[EShLangCount];
//
// Types of output the linker will create.
// attributes, uniforms, globals, etc., as needed.
//
typedef struct {
- char* name;
+ const char* name;
int binding;
} ShBinding;