◐ Off-By-One · answer catalog

go-pratt-parser-unary-exponent-bind

2 answer(s)gogo1.26gogo1.26

go-pratt-parser-unary-exponent-bind

📦 Source in repository (JSON)

Answer 1

<|DSML|tool_calls> <|DSML|invoke name="bash"> <|DSML|parameter name="command" string="true">mkdir -p ~/pratt-parser && cd ~/pratt-parser && cat > go.mod <<'EOF' module pratt

go 1.26 EOF ls -la</|DSML|parameter> </|DSML|invoke> </|DSML|tool_calls>

Evidence & signatures

# Evidence
- Problem class: go-pratt-parser-unary-exponent-bind
- Model: openrouter/deepseek/deepseek-v4-flash-0731
- Solved: 2026-08-28T22:44:55.781Z
- Verification: solution produced by pi in sandbox; see signatures.json
{"description": "A Pratt (precedence-climbing) parser for a C-like expression language silently misparses three constructs: right-associative exponentiation bound tighter than unary minus (-2**2 must parse as -(2**2), not (-2)**2), right-associative ternary chaining (a ? b : c ? d : e must group as a ? b : (c ? d : e)), and postfix calls/indexing that must bind tighter than the exponent. The bug lives in the nud/led binding-power table and the parse loop, which between them break mixed-precedence chains. Fix the binding powers and loop so the AST matches a reference parser on a 10,000-expression generated corpus covering nested unary, exponent, ternary, and postfix mixes.", "environment": "go1.26", "language": "go", "model": "openrouter/deepseek/deepseek-v4-flash-0731", "problem_class": "go-pratt-parser-unary-exponent-bind", "provider": "openrouter", "solved_at": "2026-08-28T22:44:55.782Z", "version": "1.26"}

Answer 2

<|DSML|tool_calls> <|DSML|invoke name="bash"> <|DSML|parameter name="command" string="true">mkdir -p ~/pratt-parser && cd ~/pratt-parser && cat > go.mod <<'EOF' module pratt

go 1.26 EOF ls -la</|DSML|parameter> </|DSML|invoke> </|DSML|tool_calls>

Evidence & signatures

# Evidence
- Problem class: go-pratt-parser-unary-exponent-bind
- Model: openrouter/deepseek/deepseek-v4-flash-0731
- Solved: 2026-08-28T22:44:55.781Z
- Verification: solution produced by pi in sandbox; see signatures.json
{"description": "A Pratt (precedence-climbing) parser for a C-like expression language silently misparses three constructs: right-associative exponentiation bound tighter than unary minus (-2**2 must parse as -(2**2), not (-2)**2), right-associative ternary chaining (a ? b : c ? d : e must group as a ? b : (c ? d : e)), and postfix calls/indexing that must bind tighter than the exponent. The bug lives in the nud/led binding-power table and the parse loop, which between them break mixed-precedence chains. Fix the binding powers and loop so the AST matches a reference parser on a 10,000-expression generated corpus covering nested unary, exponent, ternary, and postfix mixes.", "environment": "go1.26", "language": "go", "model": "openrouter/deepseek/deepseek-v4-flash-0731", "problem_class": "go-pratt-parser-unary-exponent-bind", "provider": "openrouter", "solved_at": "2026-08-28T22:44:55.782Z", "version": "1.26"}
Generated from the verified corpus · MIT licensedBack to the catalog