Fix compile errors: about 25 .PpError didn't compile, need to be .ppError.
This commit is contained in:
parent
4a22f9a4e2
commit
8318878c89
@ -138,7 +138,7 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken)
|
|||||||
}
|
}
|
||||||
ch = getChar();
|
ch = getChar();
|
||||||
} else {
|
} else {
|
||||||
parseContext.PpError(ppToken->loc, "float literal too long", "", "");
|
parseContext.ppError(ppToken->loc, "float literal too long", "", "");
|
||||||
len = 1;
|
len = 1;
|
||||||
str_len = 1;
|
str_len = 1;
|
||||||
}
|
}
|
||||||
@ -150,7 +150,7 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken)
|
|||||||
if (ch == 'e' || ch == 'E') {
|
if (ch == 'e' || ch == 'E') {
|
||||||
HasDecimalOrExponent = true;
|
HasDecimalOrExponent = true;
|
||||||
if (len >= TPpToken::maxTokenLength) {
|
if (len >= TPpToken::maxTokenLength) {
|
||||||
parseContext.PpError(ppToken->loc, "float literal too long", "", "");
|
parseContext.ppError(ppToken->loc, "float literal too long", "", "");
|
||||||
len = 1;
|
len = 1;
|
||||||
str_len = 1;
|
str_len = 1;
|
||||||
} else {
|
} else {
|
||||||
@ -169,13 +169,13 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken)
|
|||||||
str[len++] = (char)ch;
|
str[len++] = (char)ch;
|
||||||
ch = getChar();
|
ch = getChar();
|
||||||
} else {
|
} else {
|
||||||
parseContext.PpError(ppToken->loc, "float literal too long", "", "");
|
parseContext.ppError(ppToken->loc, "float literal too long", "", "");
|
||||||
len = 1;
|
len = 1;
|
||||||
str_len = 1;
|
str_len = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
parseContext.PpError(ppToken->loc, "bad character in float exponent", "", "");
|
parseContext.ppError(ppToken->loc, "bad character in float exponent", "", "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -187,7 +187,7 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken)
|
|||||||
if (ch == 'l' || ch == 'L') {
|
if (ch == 'l' || ch == 'L') {
|
||||||
parseContext.doubleCheck(ppToken->loc, "double floating-point suffix");
|
parseContext.doubleCheck(ppToken->loc, "double floating-point suffix");
|
||||||
if (! HasDecimalOrExponent)
|
if (! HasDecimalOrExponent)
|
||||||
parseContext.PpError(ppToken->loc, "float literal needs a decimal point or exponent", "", "");
|
parseContext.ppError(ppToken->loc, "float literal needs a decimal point or exponent", "", "");
|
||||||
int ch2 = getChar();
|
int ch2 = getChar();
|
||||||
if (ch2 != 'f' && ch2 != 'F') {
|
if (ch2 != 'f' && ch2 != 'F') {
|
||||||
ungetChar();
|
ungetChar();
|
||||||
@ -198,7 +198,7 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken)
|
|||||||
str[len++] = (char)ch2;
|
str[len++] = (char)ch2;
|
||||||
isDouble = 1;
|
isDouble = 1;
|
||||||
} else {
|
} else {
|
||||||
parseContext.PpError(ppToken->loc, "float literal too long", "", "");
|
parseContext.ppError(ppToken->loc, "float literal too long", "", "");
|
||||||
len = 1,str_len=1;
|
len = 1,str_len=1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -207,11 +207,11 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken)
|
|||||||
if (! parseContext.relaxedErrors())
|
if (! parseContext.relaxedErrors())
|
||||||
parseContext.profileRequires(ppToken->loc, ~EEsProfile, 120, nullptr, "floating-point suffix");
|
parseContext.profileRequires(ppToken->loc, ~EEsProfile, 120, nullptr, "floating-point suffix");
|
||||||
if (! HasDecimalOrExponent)
|
if (! HasDecimalOrExponent)
|
||||||
parseContext.PpError(ppToken->loc, "float literal needs a decimal point or exponent", "", "");
|
parseContext.ppError(ppToken->loc, "float literal needs a decimal point or exponent", "", "");
|
||||||
if (len < TPpToken::maxTokenLength)
|
if (len < TPpToken::maxTokenLength)
|
||||||
str[len++] = (char)ch;
|
str[len++] = (char)ch;
|
||||||
else {
|
else {
|
||||||
parseContext.PpError(ppToken->loc, "float literal too long", "", "");
|
parseContext.ppError(ppToken->loc, "float literal too long", "", "");
|
||||||
len = 1,str_len=1;
|
len = 1,str_len=1;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
@ -276,7 +276,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
ch = pp->getChar();
|
ch = pp->getChar();
|
||||||
} else {
|
} else {
|
||||||
if (! AlreadyComplained) {
|
if (! AlreadyComplained) {
|
||||||
pp->parseContext.PpError(ppToken->loc, "name too long", "", "");
|
pp->parseContext.ppError(ppToken->loc, "name too long", "", "");
|
||||||
AlreadyComplained = 1;
|
AlreadyComplained = 1;
|
||||||
}
|
}
|
||||||
ch = pp->getChar();
|
ch = pp->getChar();
|
||||||
@ -319,11 +319,11 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
} else if (ch >= 'a' && ch <= 'f') {
|
} else if (ch >= 'a' && ch <= 'f') {
|
||||||
ii = ch - 'a' + 10;
|
ii = ch - 'a' + 10;
|
||||||
} else
|
} else
|
||||||
pp->parseContext.PpError(ppToken->loc, "bad digit in hexidecimal literal", "", "");
|
pp->parseContext.ppError(ppToken->loc, "bad digit in hexidecimal literal", "", "");
|
||||||
ival = (ival << 4) | ii;
|
ival = (ival << 4) | ii;
|
||||||
} else {
|
} else {
|
||||||
if (! AlreadyComplained) {
|
if (! AlreadyComplained) {
|
||||||
pp->parseContext.PpError(ppToken->loc, "hexidecimal literal too big", "", "");
|
pp->parseContext.ppError(ppToken->loc, "hexidecimal literal too big", "", "");
|
||||||
AlreadyComplained = 1;
|
AlreadyComplained = 1;
|
||||||
}
|
}
|
||||||
ival = 0xffffffff;
|
ival = 0xffffffff;
|
||||||
@ -333,7 +333,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
(ch >= 'A' && ch <= 'F') ||
|
(ch >= 'A' && ch <= 'F') ||
|
||||||
(ch >= 'a' && ch <= 'f'));
|
(ch >= 'a' && ch <= 'f'));
|
||||||
} else {
|
} else {
|
||||||
pp->parseContext.PpError(ppToken->loc, "bad digit in hexidecimal literal", "", "");
|
pp->parseContext.ppError(ppToken->loc, "bad digit in hexidecimal literal", "", "");
|
||||||
}
|
}
|
||||||
if (ch == 'u' || ch == 'U') {
|
if (ch == 'u' || ch == 'U') {
|
||||||
if (len < TPpToken::maxTokenLength)
|
if (len < TPpToken::maxTokenLength)
|
||||||
@ -361,7 +361,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
if (len < TPpToken::maxTokenLength)
|
if (len < TPpToken::maxTokenLength)
|
||||||
ppToken->name[len++] = (char)ch;
|
ppToken->name[len++] = (char)ch;
|
||||||
else if (! AlreadyComplained) {
|
else if (! AlreadyComplained) {
|
||||||
pp->parseContext.PpError(ppToken->loc, "numeric literal too long", "", "");
|
pp->parseContext.ppError(ppToken->loc, "numeric literal too long", "", "");
|
||||||
AlreadyComplained = 1;
|
AlreadyComplained = 1;
|
||||||
}
|
}
|
||||||
if (ival <= 0x1fffffff) {
|
if (ival <= 0x1fffffff) {
|
||||||
@ -379,7 +379,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
if (len < TPpToken::maxTokenLength)
|
if (len < TPpToken::maxTokenLength)
|
||||||
ppToken->name[len++] = (char)ch;
|
ppToken->name[len++] = (char)ch;
|
||||||
else if (! AlreadyComplained) {
|
else if (! AlreadyComplained) {
|
||||||
pp->parseContext.PpError(ppToken->loc, "numeric literal too long", "", "");
|
pp->parseContext.ppError(ppToken->loc, "numeric literal too long", "", "");
|
||||||
AlreadyComplained = 1;
|
AlreadyComplained = 1;
|
||||||
}
|
}
|
||||||
ch = pp->getChar();
|
ch = pp->getChar();
|
||||||
@ -390,7 +390,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
|
|
||||||
// wasn't a float, so must be octal...
|
// wasn't a float, so must be octal...
|
||||||
if (nonOctal)
|
if (nonOctal)
|
||||||
pp->parseContext.PpError(ppToken->loc, "octal literal digit too large", "", "");
|
pp->parseContext.ppError(ppToken->loc, "octal literal digit too large", "", "");
|
||||||
|
|
||||||
if (ch == 'u' || ch == 'U') {
|
if (ch == 'u' || ch == 'U') {
|
||||||
if (len < TPpToken::maxTokenLength)
|
if (len < TPpToken::maxTokenLength)
|
||||||
@ -401,7 +401,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
ppToken->name[len] = '\0';
|
ppToken->name[len] = '\0';
|
||||||
|
|
||||||
if (octalOverflow)
|
if (octalOverflow)
|
||||||
pp->parseContext.PpError(ppToken->loc, "octal literal too big", "", "");
|
pp->parseContext.ppError(ppToken->loc, "octal literal too big", "", "");
|
||||||
|
|
||||||
ppToken->ival = (int)ival;
|
ppToken->ival = (int)ival;
|
||||||
|
|
||||||
@ -419,7 +419,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
if (len < TPpToken::maxTokenLength)
|
if (len < TPpToken::maxTokenLength)
|
||||||
ppToken->name[len++] = (char)ch;
|
ppToken->name[len++] = (char)ch;
|
||||||
else if (! AlreadyComplained) {
|
else if (! AlreadyComplained) {
|
||||||
pp->parseContext.PpError(ppToken->loc, "numeric literal too long", "", "");
|
pp->parseContext.ppError(ppToken->loc, "numeric literal too long", "", "");
|
||||||
AlreadyComplained = 1;
|
AlreadyComplained = 1;
|
||||||
}
|
}
|
||||||
ch = pp->getChar();
|
ch = pp->getChar();
|
||||||
@ -444,7 +444,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
for (int i = 0; i < numericLen; i++) {
|
for (int i = 0; i < numericLen; i++) {
|
||||||
ch = ppToken->name[i] - '0';
|
ch = ppToken->name[i] - '0';
|
||||||
if ((ival > oneTenthMaxInt) || (ival == oneTenthMaxInt && ch > remainderMaxInt)) {
|
if ((ival > oneTenthMaxInt) || (ival == oneTenthMaxInt && ch > remainderMaxInt)) {
|
||||||
pp->parseContext.PpError(ppToken->loc, "numeric literal too big", "", "");
|
pp->parseContext.ppError(ppToken->loc, "numeric literal too big", "", "");
|
||||||
ival = 0xFFFFFFFFu;
|
ival = 0xFFFFFFFFu;
|
||||||
break;
|
break;
|
||||||
} else
|
} else
|
||||||
@ -627,14 +627,14 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
do {
|
do {
|
||||||
while (ch != '*') {
|
while (ch != '*') {
|
||||||
if (ch == EOF) {
|
if (ch == EOF) {
|
||||||
pp->parseContext.PpError(ppToken->loc, "EOF in comment", "comment", "");
|
pp->parseContext.ppError(ppToken->loc, "EOF in comment", "comment", "");
|
||||||
return endOfInput;
|
return endOfInput;
|
||||||
}
|
}
|
||||||
ch = pp->getChar();
|
ch = pp->getChar();
|
||||||
}
|
}
|
||||||
ch = pp->getChar();
|
ch = pp->getChar();
|
||||||
if (ch == EOF) {
|
if (ch == EOF) {
|
||||||
pp->parseContext.PpError(ppToken->loc, "EOF in comment", "comment", "");
|
pp->parseContext.ppError(ppToken->loc, "EOF in comment", "comment", "");
|
||||||
return endOfInput;
|
return endOfInput;
|
||||||
}
|
}
|
||||||
} while (ch != '/');
|
} while (ch != '/');
|
||||||
@ -663,7 +663,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
ppToken->atom = pp->LookUpAddString(tokenText);
|
ppToken->atom = pp->LookUpAddString(tokenText);
|
||||||
return CPP_STRCONSTANT;
|
return CPP_STRCONSTANT;
|
||||||
} else {
|
} else {
|
||||||
pp->parseContext.PpError(ppToken->loc, "end of line in string", "string", "");
|
pp->parseContext.ppError(ppToken->loc, "end of line in string", "string", "");
|
||||||
return CPP_ERROR_SY;
|
return CPP_ERROR_SY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -700,7 +700,7 @@ const char* TPpContext::tokenize(TPpToken* ppToken)
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
parseContext.PpError(ppToken->loc, "preprocessor directive cannot be preceded by another token", "#", "");
|
parseContext.ppError(ppToken->loc, "preprocessor directive cannot be preceded by another token", "#", "");
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -719,10 +719,10 @@ const char* TPpContext::tokenize(TPpToken* ppToken)
|
|||||||
token == CPP_FLOATCONSTANT || token == CPP_DOUBLECONSTANT)
|
token == CPP_FLOATCONSTANT || token == CPP_DOUBLECONSTANT)
|
||||||
tokenString = ppToken->name;
|
tokenString = ppToken->name;
|
||||||
else if (token == CPP_STRCONSTANT) {
|
else if (token == CPP_STRCONSTANT) {
|
||||||
parseContext.PpError(ppToken->loc, "string literals not supported", "\"\"", "");
|
parseContext.ppError(ppToken->loc, "string literals not supported", "\"\"", "");
|
||||||
tokenString = nullptr;
|
tokenString = nullptr;
|
||||||
} else if (token == '\'') {
|
} else if (token == '\'') {
|
||||||
parseContext.PpError(ppToken->loc, "character literals not supported", "\'", "");
|
parseContext.ppError(ppToken->loc, "character literals not supported", "\'", "");
|
||||||
tokenString = nullptr;
|
tokenString = nullptr;
|
||||||
} else
|
} else
|
||||||
tokenString = GetAtomString(token);
|
tokenString = GetAtomString(token);
|
||||||
@ -740,7 +740,7 @@ const char* TPpContext::tokenize(TPpToken* ppToken)
|
|||||||
void TPpContext::missingEndifCheck()
|
void TPpContext::missingEndifCheck()
|
||||||
{
|
{
|
||||||
if (ifdepth > 0)
|
if (ifdepth > 0)
|
||||||
parseContext.PpError(parseContext.getCurrentLoc(), "missing #endif", "", "");
|
parseContext.ppError(parseContext.getCurrentLoc(), "missing #endif", "", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end namespace glslang
|
} // end namespace glslang
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user