bash_wrapper

Types

BashNodeKind = enum
  bashExpression,           ## _expression
  bashPrimaryExpression,    ## _primary_expression
  bashStatement,            ## _statement
  bashArray,                ## array
  bashBinaryExpression,     ## binary_expression
  bashCStyleForStatement,   ## c_style_for_statement
  bashCaseItem,             ## case_item
  bashCaseStatement,        ## case_statement
  bashCommand,              ## command
  bashCommandName,          ## command_name
  bashCommandSubstitution,  ## command_substitution
  bashCompoundStatement,    ## compound_statement
  bashConcatenation,        ## concatenation
  bashDeclarationCommand,   ## declaration_command
  bashDoGroup,              ## do_group
  bashElifClause,           ## elif_clause
  bashElseClause,           ## else_clause
  bashExpansion,            ## expansion
  bashFileRedirect,         ## file_redirect
  bashForStatement,         ## for_statement
  bashFunctionDefinition,   ## function_definition
  bashHeredocBody,          ## heredoc_body
  bashHeredocRedirect,      ## heredoc_redirect
  bashHerestringRedirect,   ## herestring_redirect
  bashIfStatement,          ## if_statement
  bashList,                 ## list
  bashNegatedCommand,       ## negated_command
  bashParenthesizedExpression, ## parenthesized_expression
  bashPipeline,             ## pipeline
  bashPostfixExpression,    ## postfix_expression
  bashProcessSubstitution,  ## process_substitution
  bashProgram,              ## program
  bashRedirectedStatement,  ## redirected_statement
  bashSimpleExpansion,      ## simple_expansion
  bashString,               ## string
  bashStringExpansion,      ## string_expansion
  bashSubscript,            ## subscript
  bashSubshell,             ## subshell
  bashTernaryExpression,    ## ternary_expression
  bashTestCommand,          ## test_command
  bashUnaryExpression,      ## unary_expression
  bashUnsetCommand,         ## unset_command
  bashVariableAssignment,   ## variable_assignment
  bashWhileStatement,       ## while_statement
  bashWord,                 ## word
  bashNewlineTok,           ## 
                             ## 
  bashExclamationTok,       ## !
  bashExclamationEqualTok,  ## !=
  bashQuoteTok,             ## "
  bashHashTok,              ## #
  bashDollarTok,            ## $
  bashDollarLParTok,        ## $(
  bashDollarLCurlyTok,      ## ${
  bashPercentTok,           ## %
  bashAmpersandTok,         ## &
  bashDoubleAmpersandTok,   ## &&
  bashAmpersandGreaterThanTok, ## &>
  bashAmpersandDoubleGreaterThanTok, ## &>>
  bashLParTok,              ## (
  bashDoubleLParTok,        ## ((
  bashRParTok,              ## )
  bashDoubleRParTok,        ## ))
  bashPlusTok,              ## +
  bashDoublePlusTok,        ## ++
  bashPlusEqualTok,         ## +=
  bashMinusTok,             ## -
  bashDoubleMinusTok,       ## --
  bashMinusEqualTok,        ## -=
  bashSlashTok,             ## /
  bashColonTok,             ## :
  bashColonMinusTok,        ## :-
  bashColonQuestionTok,     ## :?
  bashSemicolonTok,         ## ;
  bashSemicolonAmpersandTok, ## ;&
  bashDoubleSemicolonTok,   ## ;;
  bashDoubleSemicolonAmpersandTok, ## ;;&
  bashLessThanTok,          ## <
  bashLessThanAmpersandTok, ## <&
  bashLessThanLParTok,      ## <(
  bashDoubleLessThanTok,    ## <<
  bashDoubleLessThanMinusTok, ## <<-
  bashTripleLessThanTok,    ## <<<
  bashLessThanEqualTok,     ## <=
  bashEqualTok,             ## =
  bashDoubleEqualTok,       ## ==
  bashEqualTildeTok,        ## =~
  bashGreaterThanTok,       ## >
  bashGreaterThanAmpersandTok, ## >&
  bashGreaterThanLParTok,   ## >(
  bashGreaterThanEqualTok,  ## >=
  bashDoubleGreaterThanTok, ## >>
  bashGreaterThanPipeTok,   ## >|
  bashQuestionTok,          ## ?
  bashLBrackTok,            ## [
  bashDoubleLBrackTok,      ## [[
  bashRBrackTok,            ## ]
  bashDoubleRBrackTok,      ## ]]
  bashBacktickTok,          ## `
  bashAnsiiCString,         ## ansii_c_string
  bashCaseTok,              ## case
  bashComment,              ## comment
  bashDeclareTok,           ## declare
  bashDoTok,                ## do
  bashDoneTok,              ## done
  bashElifTok,              ## elif
  bashElseTok,              ## else
  bashEsacTok,              ## esac
  bashExportTok,            ## export
  bashFiTok,                ## fi
  bashFileDescriptor,       ## file_descriptor
  bashForTok,               ## for
  bashFunctionTok,          ## function
  bashHeredocStart,         ## heredoc_start
  bashIfTok,                ## if
  bashInTok,                ## in
  bashLocalTok,             ## local
  bashRawString,            ## raw_string
  bashReadonlyTok,          ## readonly
  bashRegex,                ## regex
  bashSpecialVariableName,  ## special_variable_name
  bashTestOperator,         ## test_operator
  bashThenTok,              ## then
  bashTypesetTok,           ## typeset
  bashUnsetTok,             ## unset
  bashUnsetenvTok,          ## unsetenv
  bashVariableName,         ## variable_name
  bashWhileTok,             ## while
  bashLCurlyTok,            ## {
  bashPipeTok,              ## |
  bashPipeAmpersandTok,     ## |&
  bashDoublePipeTok,        ## ||
  bashRCurlyTok,            ## }
  bashSyntaxError            ## Tree-sitter parser syntax error
BashExternalTok = enum
  bashExternHeredoc_start,  ## heredoc_start
  bashExtern_simple_heredoc_body, ## _simple_heredoc_body
  bashExtern_heredoc_body_beginning, ## _heredoc_body_beginning
  bashExtern_heredoc_body_middle, ## _heredoc_body_middle
  bashExtern_heredoc_body_end, ## _heredoc_body_end
  bashExternFile_descriptor, ## file_descriptor
  bashExtern_empty_value,   ## _empty_value
  bashExtern_concat,        ## _concat
  bashExternVariable_name,  ## variable_name
  bashExternRegex            ## regex
TsBashNode = distinct TSNode
BashParser = distinct PtsParser
BashNode = HtsNode[TsBashNode, BashNodeKind]

Procs

proc kind(node: TsBashNode): BashNodeKind {...}{.noSideEffect, raises: [Exception],
    tags: [RootEffect].}
proc tsNodeType(node: TsBashNode): string {...}{.raises: [], tags: [].}
proc newTsBashParser(): BashParser {...}{.raises: [], tags: [].}
proc parseString(parser: BashParser; str: string): TsBashNode {...}{.raises: [],
    tags: [].}
proc parseTsBashString(str: string): TsBashNode {...}{.raises: [], tags: [].}
proc treeReprTsBash(str: string; unnamed: bool = false): string {...}{.
    raises: [ValueError, Exception, NilArgumentError], tags: [RootEffect].}
proc toHtsNode(node: TsBashNode; str: ptr string): HtsNode[TsBashNode,
    BashNodeKind] {...}{.raises: [NilArgumentError, Exception], tags: [RootEffect].}
proc toHtsTree(node: TsBashNode; str: ptr string): BashNode {...}{.
    raises: [NilArgumentError, Exception], tags: [RootEffect].}
proc parseBashString(str: ptr string; unnamed: bool = false): BashNode {...}{.
    raises: [NilArgumentError, Exception], tags: [RootEffect].}
proc parseBashString(str: string; unnamed: bool = false): BashNode {...}{.
    raises: [NilArgumentError, Exception], tags: [RootEffect].}

Funcs

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