moor
moor copied to clipboard
Drive Pratt and unparse/decompile code from one common precedence table.
https://github.com/rdaum/moor/blob/47435a1442a1f5532c23944029e90982baa99bff/crates/compiler/src/unparse.rs#L38
// directly on http://en.cppreference.com/w/cpp/language/operator_precedence
// Should be kept in sync with the pratt parser in `parse.rs`
// Starting from lowest to highest precedence...
// TODO: drive Pratt and this from one common precedence table.
let cpp_ref_prep = match self {
Expr::Scatter(_, _) | Expr::Assign { .. } => 14,
Expr::Cond { .. } => 13,