Skip to main content

check_consecutive_binary_ops

Function check_consecutive_binary_ops 

Source
fn check_consecutive_binary_ops(seq: &[TokenTree]) -> Result<(), Error>
Expand description

Returns an error if two consecutive non-unary binary operators appear with nothing between them (x * * y, x / / y).

Unary-capable operators (+, -, !, ~, ?) are never flagged — they chain legally (x - - y). Joint-spaced pairs are never flagged either: that skips every multi-char operator (<-, ->, <=, %%, %in%’s delimiters) and **, which R’s parser accepts as an undocumented synonym for ^.