Skip to content

Commit

Permalink
Re-export all AST types in the C and C++ domains
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Apr 17, 2024
1 parent 630fe86 commit 45fab85
Show file tree
Hide file tree
Showing 3 changed files with 147 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Release 7.3.6 (in development)
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)
=====================================
Expand Down
53 changes: 53 additions & 0 deletions sphinx/domains/c/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,59 @@
from sphinx.environment import BuildEnvironment
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__)


Expand Down
92 changes: 92 additions & 0 deletions sphinx/domains/cpp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,98 @@
from sphinx.environment import BuildEnvironment
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__)


Expand Down

0 comments on commit 45fab85

Please sign in to comment.