resolve

Function resolve 

Source
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:

  1. 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.
  2. Insert a TOKEN_BLANK for every missing argument and a TOKEN_JUXTAPOSE for every missing binary operator.