Skip to main content

Module: languages/branchMatcher

Functions

branchMatcher

branchMatcher(statementType, optionalBranchTypes): NodeMatcher

Constructs a branch matcher for constructs that have a primary branch followed by zero or more optional branches, such as if statements or try statements

Parameters

NameTypeDescription
statementTypestringThe top-level statement type for this construct, eg "if_statement" or "try_statement"
optionalBranchTypesstring[]The optional branch type names that can be children of the top-level statement, eg "else_clause" or "except_clause"

Returns

NodeMatcher

A node matcher capabale of matching this type of branch

Defined in

languages/branchMatcher.ts:20