cpp_wrapper

Types

CppNodeKind = enum
  cppAbstractDeclarator,    ## _abstract_declarator
  cppDeclarator,            ## _declarator
  cppExpression,            ## _expression
  cppFieldDeclarator,       ## _field_declarator
  cppStatement,             ## _statement
  cppTypeDeclarator,        ## _type_declarator
  cppTypeSpecifier,         ## _type_specifier
  cppAbstractArrayDeclarator, ## abstract_array_declarator
  cppAbstractFunctionDeclarator, ## abstract_function_declarator
  cppAbstractParenthesizedDeclarator, ## abstract_parenthesized_declarator
  cppAbstractPointerDeclarator, ## abstract_pointer_declarator
  cppAbstractReferenceDeclarator, ## abstract_reference_declarator
  cppAccessSpecifier,       ## access_specifier
  cppAliasDeclaration,      ## alias_declaration
  cppArgumentList,          ## argument_list
  cppArrayDeclarator,       ## array_declarator
  cppAssignmentExpression,  ## assignment_expression
  cppAttribute,             ## attribute
  cppAttributeSpecifier,    ## attribute_specifier
  cppBaseClassClause,       ## base_class_clause
  cppBinaryExpression,      ## binary_expression
  cppBitfieldClause,        ## bitfield_clause
  cppBreakStatement,        ## break_statement
  cppCallExpression,        ## call_expression
  cppCaseStatement,         ## case_statement
  cppCastExpression,        ## cast_expression
  cppCatchClause,           ## catch_clause
  cppCharLiteral,           ## char_literal
  cppClassSpecifier,        ## class_specifier
  cppCommaExpression,       ## comma_expression
  cppCompoundLiteralExpression, ## compound_literal_expression
  cppCompoundStatement,     ## compound_statement
  cppConcatenatedString,    ## concatenated_string
  cppConditionClause,       ## condition_clause
  cppConditionalExpression, ## conditional_expression
  cppContinueStatement,     ## continue_statement
  cppDeclaration,           ## declaration
  cppDeclarationList,       ## declaration_list
  cppDecltype,              ## decltype
  cppDefaultMethodClause,   ## default_method_clause
  cppDeleteExpression,      ## delete_expression
  cppDeleteMethodClause,    ## delete_method_clause
  cppDependentType,         ## dependent_type
  cppDestructorName,        ## destructor_name
  cppDoStatement,           ## do_statement
  cppEnumSpecifier,         ## enum_specifier
  cppEnumerator,            ## enumerator
  cppEnumeratorList,        ## enumerator_list
  cppExplicitFunctionSpecifier, ## explicit_function_specifier
  cppExpressionStatement,   ## expression_statement
  cppFieldDeclaration,      ## field_declaration
  cppFieldDeclarationList,  ## field_declaration_list
  cppFieldDesignator,       ## field_designator
  cppFieldExpression,       ## field_expression
  cppFieldInitializer,      ## field_initializer
  cppFieldInitializerList,  ## field_initializer_list
  cppForRangeLoop,          ## for_range_loop
  cppForStatement,          ## for_statement
  cppFriendDeclaration,     ## friend_declaration
  cppFunctionDeclarator,    ## function_declarator
  cppFunctionDefinition,    ## function_definition
  cppGotoStatement,         ## goto_statement
  cppIfStatement,           ## if_statement
  cppInitDeclarator,        ## init_declarator
  cppInitializerList,       ## initializer_list
  cppInitializerPair,       ## initializer_pair
  cppLabeledStatement,      ## labeled_statement
  cppLambdaCaptureSpecifier, ## lambda_capture_specifier
  cppLambdaDefaultCapture,  ## lambda_default_capture
  cppLambdaExpression,      ## lambda_expression
  cppLinkageSpecification,  ## linkage_specification
  cppMsBasedModifier,       ## ms_based_modifier
  cppMsCallModifier,        ## ms_call_modifier
  cppMsDeclspecModifier,    ## ms_declspec_modifier
  cppMsPointerModifier,     ## ms_pointer_modifier
  cppMsUnalignedPtrModifier, ## ms_unaligned_ptr_modifier
  cppNamespaceDefinition,   ## namespace_definition
  cppNewDeclarator,         ## new_declarator
  cppNewExpression,         ## new_expression
  cppNoexcept,              ## noexcept
  cppOperatorCast,          ## operator_cast
  cppOptionalParameterDeclaration, ## optional_parameter_declaration
  cppOptionalTypeParameterDeclaration, ## optional_type_parameter_declaration
  cppParameterDeclaration,  ## parameter_declaration
  cppParameterList,         ## parameter_list
  cppParameterPackExpansion, ## parameter_pack_expansion
  cppParenthesizedDeclarator, ## parenthesized_declarator
  cppParenthesizedExpression, ## parenthesized_expression
  cppPointerDeclarator,     ## pointer_declarator
  cppPointerExpression,     ## pointer_expression
  cppPreprocCall,           ## preproc_call
  cppPreprocDef,            ## preproc_def
  cppPreprocDefined,        ## preproc_defined
  cppPreprocElif,           ## preproc_elif
  cppPreprocElse,           ## preproc_else
  cppPreprocFunctionDef,    ## preproc_function_def
  cppPreprocIf,             ## preproc_if
  cppPreprocIfdef,          ## preproc_ifdef
  cppPreprocInclude,        ## preproc_include
  cppPreprocParams,         ## preproc_params
  cppReferenceDeclarator,   ## reference_declarator
  cppReturnStatement,       ## return_statement
  cppScopedFieldIdentifier, ## scoped_field_identifier
  cppScopedIdentifier,      ## scoped_identifier
  cppScopedNamespaceIdentifier, ## scoped_namespace_identifier
  cppScopedTypeIdentifier,  ## scoped_type_identifier
  cppSizedTypeSpecifier,    ## sized_type_specifier
  cppSizeofExpression,      ## sizeof_expression
  cppStaticAssertDeclaration, ## static_assert_declaration
  cppStorageClassSpecifier, ## storage_class_specifier
  cppStringLiteral,         ## string_literal
  cppStructSpecifier,       ## struct_specifier
  cppStructuredBindingDeclarator, ## structured_binding_declarator
  cppSubscriptDesignator,   ## subscript_designator
  cppSubscriptExpression,   ## subscript_expression
  cppSwitchStatement,       ## switch_statement
  cppTemplateArgumentList,  ## template_argument_list
  cppTemplateDeclaration,   ## template_declaration
  cppTemplateFunction,      ## template_function
  cppTemplateInstantiation, ## template_instantiation
  cppTemplateMethod,        ## template_method
  cppTemplateParameterList, ## template_parameter_list
  cppTemplateTemplateParameterDeclaration, ## template_template_parameter_declaration
  cppTemplateType,          ## template_type
  cppThrowSpecifier,        ## throw_specifier
  cppThrowStatement,        ## throw_statement
  cppTrailingReturnType,    ## trailing_return_type
  cppTranslationUnit,       ## translation_unit
  cppTryStatement,          ## try_statement
  cppTypeDefinition,        ## type_definition
  cppTypeDescriptor,        ## type_descriptor
  cppTypeParameterDeclaration, ## type_parameter_declaration
  cppTypeQualifier,         ## type_qualifier
  cppUnaryExpression,       ## unary_expression
  cppUnionSpecifier,        ## union_specifier
  cppUpdateExpression,      ## update_expression
  cppUsingDeclaration,      ## using_declaration
  cppVariadicDeclarator,    ## variadic_declarator
  cppVariadicParameterDeclaration, ## variadic_parameter_declaration
  cppVariadicTypeParameterDeclaration, ## variadic_type_parameter_declaration
  cppVirtualFunctionSpecifier, ## virtual_function_specifier
  cppVirtualSpecifier,      ## virtual_specifier
  cppWhileStatement,        ## while_statement
  cppNewlineTok,            ## 
                             ## 
  cppExclamationTok,        ## !
  cppExclamationEqualTok,   ## !=
  cppQuoteTok,              ## "
  cppHashdefineTok,         ## #define
  cppHashelifTok,           ## #elif
  cppHashelseTok,           ## #else
  cppHashendifTok,          ## #endif
  cppHashifTok,             ## #if
  cppHashifdefTok,          ## #ifdef
  cppHashifndefTok,         ## #ifndef
  cppHashincludeTok,        ## #include
  cppPercentTok,            ## %
  cppPercentEqualTok,       ## %=
  cppAmpersandTok,          ## &
  cppDoubleAmpersandTok,    ## &&
  cppAmpersandEqualTok,     ## &=
  cppApostropheTok,         ## '
  cppLParTok,               ## (
  cppRParTok,               ## )
  cppAsteriskTok,           ## *
  cppAsteriskEqualTok,      ## *=
  cppPlusTok,               ## +
  cppDoublePlusTok,         ## ++
  cppPlusEqualTok,          ## +=
  cppCommaTok,              ## ,
  cppMinusTok,              ## -
  cppDoubleMinusTok,        ## --
  cppMinusEqualTok,         ## -=
  cppMinusGreaterThanTok,   ## ->
  cppDotTok,                ## .
  cppTripleDotTok,          ## ...
  cppSlashTok,              ## /
  cppSlashEqualTok,         ## /=
  cppColonTok,              ## :
  cppDoubleColonTok,        ## ::
  cppSemicolonTok,          ## ;
  cppLessThanTok,           ## <
  cppDoubleLessThanTok,     ## <<
  cppDoubleLessThanEqualTok, ## <<=
  cppLessThanEqualTok,      ## <=
  cppEqualTok,              ## =
  cppDoubleEqualTok,        ## ==
  cppGreaterThanTok,        ## >
  cppGreaterThanEqualTok,   ## >=
  cppDoubleGreaterThanTok,  ## >>
  cppDoubleGreaterThanEqualTok, ## >>=
  cppQuestionTok,           ## ?
  cppLQuoteTok,             ## L"
  cppLApostropheTok,        ## L'
  cppUQuoteTok,             ## U"
  cppUApostropheTok,        ## U'
  cppLBrackTok,             ## [
  cppDoubleLBrackTok,       ## [[
  cppRBrackTok,             ## ]
  cppDoubleRBrackTok,       ## ]]
  cppAccentTok,             ## ^
  cppAccentEqualTok,        ## ^=
  cppAtomicTok,             ## _Atomic
  cppAttributeTok,          ## __attribute__
  cppBasedTok,              ## __based
  cppCdeclTok,              ## __cdecl
  cppClrcallTok,            ## __clrcall
  cppDeclspecTok,           ## __declspec
  cppFastcallTok,           ## __fastcall
  cppStdcallTok,            ## __stdcall
  cppThiscallTok,           ## __thiscall
  cppUnalignedTok,          ## __unaligned
  cppVectorcallTok,         ## __vectorcall
  cppAuto,                  ## auto
  cppBreakTok,              ## break
  cppCaseTok,               ## case
  cppCatchTok,              ## catch
  cppClassTok,              ## class
  cppComment,               ## comment
  cppConstTok,              ## const
  cppConstexprTok,          ## constexpr
  cppContinueTok,           ## continue
  cppDecltypeTok,           ## decltype
  cppDefaultTok,            ## default
  cppDefinedTok,            ## defined
  cppDeleteTok,             ## delete
  cppDoTok,                 ## do
  cppElseTok,               ## else
  cppEnumTok,               ## enum
  cppEscapeSequence,        ## escape_sequence
  cppExplicitTok,           ## explicit
  cppExternTok,             ## extern
  cppFalse,                 ## false
  cppFieldIdentifier,       ## field_identifier
  cppFinalTok,              ## final
  cppForTok,                ## for
  cppFriendTok,             ## friend
  cppGotoTok,               ## goto
  cppIdentifier,            ## identifier
  cppIfTok,                 ## if
  cppInlineTok,             ## inline
  cppLongTok,               ## long
  cppMsRestrictModifier,    ## ms_restrict_modifier
  cppMsSignedPtrModifier,   ## ms_signed_ptr_modifier
  cppMsUnsignedPtrModifier, ## ms_unsigned_ptr_modifier
  cppMutableTok,            ## mutable
  cppNamespaceTok,          ## namespace
  cppNamespaceIdentifier,   ## namespace_identifier
  cppNewTok,                ## new
  cppNoexceptTok,           ## noexcept
  cppNull,                  ## null
  cppNullptr,               ## nullptr
  cppNumberLiteral,         ## number_literal
  cppOperatorTok,           ## operator
  cppOperatorName,          ## operator_name
  cppOverrideTok,           ## override
  cppPreprocArg,            ## preproc_arg
  cppPreprocDirective,      ## preproc_directive
  cppPrimitiveType,         ## primitive_type
  cppPrivateTok,            ## private
  cppProtectedTok,          ## protected
  cppPublicTok,             ## public
  cppRawStringLiteral,      ## raw_string_literal
  cppRegisterTok,           ## register
  cppRestrictTok,           ## restrict
  cppReturnTok,             ## return
  cppShortTok,              ## short
  cppSignedTok,             ## signed
  cppSizeofTok,             ## sizeof
  cppStatementIdentifier,   ## statement_identifier
  cppStaticTok,             ## static
  cppStaticAssertTok,       ## static_assert
  cppStructTok,             ## struct
  cppSwitchTok,             ## switch
  cppSystemLibString,       ## system_lib_string
  cppTemplateTok,           ## template
  cppThis,                  ## this
  cppThrowTok,              ## throw
  cppTrue,                  ## true
  cppTryTok,                ## try
  cppTypeIdentifier,        ## type_identifier
  cppTypedefTok,            ## typedef
  cppTypenameTok,           ## typename
  cppU8QuoteTok,            ## u8"
  cppU8ApostropheTok,       ## u8'
  cppUnionTok,              ## union
  cppUnsignedTok,           ## unsigned
  cppUsingTok,              ## using
  cppVirtualTok,            ## virtual
  cppVolatileTok,           ## volatile
  cppWhileTok,              ## while
  cppLCurlyTok,             ## {
  cppPipeTok,               ## |
  cppPipeEqualTok,          ## |=
  cppDoublePipeTok,         ## ||
  cppRCurlyTok,             ## }
  cppTildeTok,              ## ~
  cppSyntaxError             ## Tree-sitter parser syntax error
CppExternalTok = enum
  cppExternRaw_string_literal ## raw_string_literal
TsCppNode = distinct TSNode
CppParser = distinct PtsParser
CppNode = HtsNode[TsCppNode, CppNodeKind]

Procs

proc kind(node: TsCppNode): CppNodeKind {...}{.noSideEffect, raises: [Exception],
    tags: [RootEffect].}
proc tsNodeType(node: TsCppNode): string {...}{.raises: [], tags: [].}
proc newTsCppParser(): CppParser {...}{.raises: [], tags: [].}
proc parseString(parser: CppParser; str: string): TsCppNode {...}{.raises: [],
    tags: [].}
proc parseTsCppString(str: string): TsCppNode {...}{.raises: [], tags: [].}
proc treeReprTsCpp(str: string; unnamed: bool = false): string {...}{.
    raises: [ValueError, Exception, NilArgumentError], tags: [RootEffect].}
proc toHtsNode(node: TsCppNode; str: ptr string): HtsNode[TsCppNode, CppNodeKind] {...}{.
    raises: [NilArgumentError, Exception], tags: [RootEffect].}
proc toHtsTree(node: TsCppNode; str: ptr string): CppNode {...}{.
    raises: [NilArgumentError, Exception], tags: [RootEffect].}
proc parseCppString(str: ptr string; unnamed: bool = false): CppNode {...}{.
    raises: [NilArgumentError, Exception], tags: [RootEffect].}
proc parseCppString(str: string; unnamed: bool = false): CppNode {...}{.
    raises: [NilArgumentError, Exception], tags: [RootEffect].}

Funcs

func isNil(node: TsCppNode): bool {...}{.raises: [], tags: [].}
func len(node: TsCppNode; unnamed: bool = false): int {...}{.raises: [], tags: [].}
func has(node: TsCppNode; idx: int; unnamed: bool = false): bool {...}{.raises: [],
    tags: [].}
func `$`(node: TsCppNode): string {...}{.raises: [Exception], tags: [RootEffect].}
func `[]`(node: TsCppNode; idx: int; kind: CppNodeKind | set[CppNodeKind]): TsCppNode