pub fn resolve(
tok_to_prefix: &[Option<(TokenId, bool)>],
tok_to_suffix: &[Option<(TokenId, bool)>],
optok_to_follower: &[Option<(TokenId, TokenId, bool)>],
input: impl IntoIterator<Item = Lexeme>,
) -> Result<Vec<Lexeme>, ResolverError>Expand description
Resolve “tokens” into “op tokens”. Both have type usize but are in different spaces (i.e. the
token 4 and the op token 4 are likely unrelated). This resolution achieves two tasks:
- If the same token is used in multiple operators, disambiguate them. For example, unary minus and binary minus would have the same token but different op tokens.
- Insert a
TOKEN_BLANKfor every missing argument and aTOKEN_JUXTAPOSEfor every missing binary operator.