odin-lang / Odin

Odin Programming Language
https://odin-lang.org
BSD 3-Clause "New" or "Revised" License
6.13k stars 551 forks source link

Fix `or_or_<branch>` error message #3719

Closed Feoramund closed 3 weeks ago

Feoramund commented 3 weeks ago

I got an odd error message while trying out some of the or_<branch> features.

/tmp/odin/a.odin(5:12) Syntax_Error: 'or_or_break' within a binary expression not wrapped in parentheses (...)
    i % 2 == 0 or_break
             ^~~~~~~~~^
package main

main :: proc() {
    for i in 0 ..< 10 {
        i % 2 == 0 or_break
    }
}

This PR fixes two problems. One is that Syntax Error is being printed with an underscore in this particular syntax_error_with_verbose function, and the other is the or_or_ bit.