Create a new ppRequireExtensions method for preprocessor.
Now extensions required by preprocessor should be checked via the ppRequireExtensions method. This is more clear and coherent with the rest of the code.
This commit is contained in:
parent
1eed969b2d
commit
484bb12703
3 changed files with 42 additions and 20 deletions
|
|
@ -675,7 +675,7 @@ int TPpContext::CPPline(TPpToken* ppToken)
|
|||
|
||||
if (token != '\n') {
|
||||
if (token == PpAtomConstString) {
|
||||
parseContext.requireExtensions(directiveLoc, 1, &E_GL_GOOGLE_cpp_style_line_directive, "filename-based #line", true);
|
||||
parseContext.ppRequireExtensions(directiveLoc, 1, &E_GL_GOOGLE_cpp_style_line_directive, "filename-based #line");
|
||||
// We need to save a copy of the string instead of pointing
|
||||
// to the name field of the token since the name field
|
||||
// will likely be overwritten by the next token scan.
|
||||
|
|
@ -892,7 +892,7 @@ int TPpContext::readCPPline(TPpToken* ppToken)
|
|||
token = CPPifdef(0, ppToken);
|
||||
break;
|
||||
case PpAtomInclude:
|
||||
parseContext.requireExtensions(ppToken->loc, 1, &E_GL_GOOGLE_include_directive, "#include", true);
|
||||
parseContext.ppRequireExtensions(ppToken->loc, 1, &E_GL_GOOGLE_include_directive, "#include");
|
||||
token = CPPinclude(ppToken);
|
||||
break;
|
||||
case PpAtomLine:
|
||||
|
|
@ -1017,7 +1017,7 @@ int TPpContext::MacroExpand(int atom, TPpToken* ppToken, bool expandUndef, bool
|
|||
|
||||
case PpAtomFileMacro: {
|
||||
if (const char* current_file = parseContext.getCurrentLoc().name) {
|
||||
parseContext.requireExtensions(ppToken->loc, 1, &E_GL_GOOGLE_cpp_style_line_directive, "filename-based __FILE__", true);
|
||||
parseContext.ppRequireExtensions(ppToken->loc, 1, &E_GL_GOOGLE_cpp_style_line_directive, "filename-based __FILE__");
|
||||
sprintf(ppToken->name, "\"%s\"", current_file);
|
||||
} else {
|
||||
ppToken->ival = parseContext.getCurrentLoc().string;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue