Module utils

Source
Expand description

Utility functions for the parser

Functionsยง

check_ok_needed_outputs
comma_separate
Splits out a token slice into a vector of token slices, separated by commas.
find_matching_parenthesis
Finds the index of the matching parenthesis in the token slice. This function assumes that the opening parenthesis is not part of the slice.
gather_all
Match as many tokens of any kind as possible. Always consumes the entire token slice
gather_operands
Given a list of list of types, gather operands whose type together matches any of the variants. Returns the nodes matching the longest variant.