Skip to main content

Module matching

Module matching 

Source
Expand description

This module is responsible for matching a search pattern against a node in the AST. In the process of matching, placeholder values are recorded.

MacrosΒ§

fail_match πŸ”’
match_error πŸ”’

StructsΒ§

Match
Information about a match that was found.
MatchFailed πŸ”’
An β€œerror” indicating that matching failed. Use the fail_match! macro to create and return this.
MatchFailureReason πŸ”’
Matcher πŸ”’
Checks if our search pattern matches a particular node of the AST.
PatternIterator πŸ”’
PlaceholderMatch πŸ”’
Information about a placeholder bound in a match.

EnumsΒ§

Phase πŸ”’
Which phase of matching we’re currently performing. We do two phases because most attempted matches will fail and it means we can defer more expensive checks to the second phase.

ConstantsΒ§

RECORDING_MATCH_FAIL_REASONS

FunctionsΒ§

get_match πŸ”’
Checks if code matches the search pattern found in search_scope, returning information about the match, if it does. Since we only do matching in this module and searching is done by the parent module, we don’t populate nested matches.
is_closing_token πŸ”’
only_ident πŸ”’
record_match_fails_reasons_scope πŸ”’
recording_match_fail_reasons πŸ”’