- Enhancement: Support C11 ano
This commit is contained in:
parent
5bd1d92d53
commit
60db5a894b
1
NEWS.md
1
NEWS.md
|
@ -3,6 +3,7 @@ Red Panda C++ Version 2.13
|
||||||
- fix: Only C/C++/GAS files can set breakpoints.
|
- fix: Only C/C++/GAS files can set breakpoints.
|
||||||
- Enhancement: Don't show breakpoints/watch related menuitems in context menu for non-C/C++/GAS files.
|
- Enhancement: Don't show breakpoints/watch related menuitems in context menu for non-C/C++/GAS files.
|
||||||
- Enhancement: Disable reformat code for non-C/C++ files.
|
- Enhancement: Disable reformat code for non-C/C++ files.
|
||||||
|
- Enhancement: Support C11 ano
|
||||||
|
|
||||||
Red Panda C++ Version 2.12
|
Red Panda C++ Version 2.12
|
||||||
|
|
||||||
|
|
|
@ -3398,6 +3398,15 @@ void CppParser::handleStructs(bool isTypedef)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!firstSynonym) {
|
if (!firstSynonym) {
|
||||||
|
PStatement scope = getCurrentScope();
|
||||||
|
if (scope && scope->kind == StatementKind::skClass
|
||||||
|
&& mIndex<mTokenizer.tokenCount() && mTokenizer[mIndex]->text=="{") {
|
||||||
|
//C11 anonymous union/struct
|
||||||
|
addSoloScopeLevel(scope, mTokenizer[mIndex]->line);
|
||||||
|
//skip {
|
||||||
|
mIndex++;
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
//anonymous union/struct/class, add as a block
|
//anonymous union/struct/class, add as a block
|
||||||
firstSynonym=addStatement(
|
firstSynonym=addStatement(
|
||||||
getCurrentScope(),
|
getCurrentScope(),
|
||||||
|
@ -3413,6 +3422,7 @@ void CppParser::handleStructs(bool isTypedef)
|
||||||
mClassScope,
|
mClassScope,
|
||||||
StatementProperty::spHasDefinition);
|
StatementProperty::spHasDefinition);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (mIndex < mTokenizer.tokenCount())
|
if (mIndex < mTokenizer.tokenCount())
|
||||||
addSoloScopeLevel(firstSynonym,mTokenizer[mIndex]->line);
|
addSoloScopeLevel(firstSynonym,mTokenizer[mIndex]->line);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue