Re-export all AST types in the C and C++ domains

This commit is contained in:
Adam Turner 2024-04-17 18:20:11 +01:00
parent 630fe865df
commit 45fab85295
3 changed files with 147 additions and 0 deletions

View File

@ -4,6 +4,8 @@ Release 7.3.6 (in development)
Bugs fixed Bugs fixed
---------- ----------
* #12295: Re-export all AST types in the C and C++ domains.
Patch by Adam Turner.
Release 7.3.5 (released Apr 17, 2024) Release 7.3.5 (released Apr 17, 2024)
===================================== =====================================

View File

@ -44,6 +44,59 @@ if TYPE_CHECKING:
from sphinx.environment import BuildEnvironment from sphinx.environment import BuildEnvironment
from sphinx.util.typing import ExtensionMetadata, OptionSpec from sphinx.util.typing import ExtensionMetadata, OptionSpec
# re-export objects for backwards compatibility
# xref https://github.com/sphinx-doc/sphinx/issues/12295
from sphinx.domains.c._ast import ( # NoQA: F401
ASTAlignofExpr,
ASTArray,
ASTAssignmentExpr,
ASTBase,
ASTBinOpExpr,
ASTBooleanLiteral,
ASTBracedInitList,
ASTCastExpr,
ASTCharLiteral,
ASTDeclarator,
ASTDeclaratorNameBitField,
ASTDeclaratorNameParam,
ASTDeclaratorParen,
ASTDeclaratorPtr,
ASTDeclSpecs,
ASTDeclSpecsSimple,
ASTEnum,
ASTEnumerator,
ASTExpression,
ASTFallbackExpr,
ASTFunctionParameter,
ASTIdExpression,
ASTInitializer,
ASTLiteral,
ASTMacro,
ASTMacroParameter,
ASTNumberLiteral,
ASTParameters,
ASTParenExpr,
ASTParenExprList,
ASTPostfixArray,
ASTPostfixCallExpr,
ASTPostfixDec,
ASTPostfixExpr,
ASTPostfixInc,
ASTPostfixMemberOfPointer,
ASTPostfixOp,
ASTSizeofExpr,
ASTSizeofType,
ASTStringLiteral,
ASTStruct,
ASTTrailingTypeSpec,
ASTTrailingTypeSpecFundamental,
ASTTrailingTypeSpecName,
ASTType,
ASTTypeWithInit,
ASTUnaryOpExpr,
ASTUnion,
)
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)

View File

@ -48,6 +48,98 @@ if TYPE_CHECKING:
from sphinx.environment import BuildEnvironment from sphinx.environment import BuildEnvironment
from sphinx.util.typing import ExtensionMetadata, OptionSpec from sphinx.util.typing import ExtensionMetadata, OptionSpec
# re-export objects for backwards compatibility
# xref https://github.com/sphinx-doc/sphinx/issues/12295
from sphinx.domains.cpp._ast import ( # NoQA: F401
ASTAlignofExpr,
ASTArray,
ASTAssignmentExpr,
ASTBase,
ASTBaseClass,
ASTBinOpExpr,
ASTBooleanLiteral,
ASTBracedInitList,
ASTCastExpr,
ASTCharLiteral,
ASTClass,
ASTCommaExpr,
ASTConcept,
ASTConditionalExpr,
ASTDeclarator,
ASTDeclaratorMemPtr,
ASTDeclaratorNameBitField,
ASTDeclaratorNameParamQual,
ASTDeclaratorParamPack,
ASTDeclaratorParen,
ASTDeclaratorPtr,
ASTDeclaratorRef,
ASTDeclSpecs,
ASTDeclSpecsSimple,
ASTDeleteExpr,
ASTEnum,
ASTEnumerator,
ASTExplicitCast,
ASTExplicitSpec,
ASTExpression,
ASTFallbackExpr,
ASTFoldExpr,
ASTFunctionParameter,
ASTIdExpression,
ASTInitializer,
ASTLiteral,
ASTNewExpr,
ASTNoexceptExpr,
ASTNoexceptSpec,
ASTNumberLiteral,
ASTOperator,
ASTOperatorBuildIn,
ASTOperatorLiteral,
ASTOperatorType,
ASTPackExpansionExpr,
ASTParametersQualifiers,
ASTParenExpr,
ASTParenExprList,
ASTPointerLiteral,
ASTPostfixArray,
ASTPostfixCallExpr,
ASTPostfixDec,
ASTPostfixExpr,
ASTPostfixInc,
ASTPostfixMember,
ASTPostfixMemberOfPointer,
ASTPostfixOp,
ASTRequiresClause,
ASTSizeofExpr,
ASTSizeofParamPack,
ASTSizeofType,
ASTStringLiteral,
ASTTemplateArgConstant,
ASTTemplateArgs,
ASTTemplateDeclarationPrefix,
ASTTemplateIntroduction,
ASTTemplateIntroductionParameter,
ASTTemplateKeyParamPackIdDefault,
ASTTemplateParam,
ASTTemplateParamConstrainedTypeWithInit,
ASTTemplateParamNonType,
ASTTemplateParams,
ASTTemplateParamTemplateType,
ASTTemplateParamType,
ASTThisLiteral,
ASTTrailingTypeSpec,
ASTTrailingTypeSpecDecltype,
ASTTrailingTypeSpecDecltypeAuto,
ASTTrailingTypeSpecFundamental,
ASTTrailingTypeSpecName,
ASTType,
ASTTypeId,
ASTTypeUsing,
ASTTypeWithInit,
ASTUnaryOpExpr,
ASTUnion,
ASTUserDefinedLiteral,
)
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)