moor icon indicating copy to clipboard operation
moor copied to clipboard

Drive Pratt and unparse/decompile code from one common precedence table.

Open github-actions[bot] opened this issue 4 months ago • 0 comments

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,

github-actions[bot] avatar Feb 10 '24 01:02 github-actions[bot]