| (pipe) has the highest precedence, contradicting the README; {{= user.name | uppercase() }} fails to parse #20
Labels
No labels
automated-🤖
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Hemera/nomo#20
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The README states: "The
|operator has the lowest precedence of the operators."In
src/parser/mod.rs:973the pipe is registered asLeft(99). Winnow's Pratt parser treats higher numbers as tighter binding, so|is currently the tightest operator — above postfix?/[(23) and.(22).Consequences (both verified against
main):{{= user.name | uppercase() }}→ parse error. The.parses its rhs at min-power 23, but|(99) binds tighter, so the rhs becomesname | uppercase(), which the Dot rhs-restriction rejects.{{= foo | f().name }}parses as(foo | f()).name(opposite of what "lowest precedence" implies).Fix: give
|the lowest precedence (e.g. below||at 7). Thenuser.name | uppercase()parses as(user.name) | uppercase()whilefoo? | or_default("Unknown")still works (?is postfix, binds tighter).