Files
Odin/src
Krzesimir Nowak 8bdf82ac8d Fix separating of diverging procedure types from block statements
To avoid creating a procedure literal from a procedure type and a
following block statement, one can insert a semicolon or an empty line
between the two:

    // procedure literals
    p1 :: proc() {…}
    p2 :: proc()
    {…}
    // procedure type followed by a block statement
    p3 :: proc()

    {…}

The empty line as a separator did not work if the procedure type had a
diverging result:

    // all of these are procedure literals
    p4 :: proc() -> ! {…}
    p5 :: proc() -> !
    {…}
    p6 :: proc() -> !

    {…}

The least annoying fix I came up with is to insert implicit semicolon
after the "not" token. I only needed to make sure that the inserted
implicit semicolon is being skipped when the "not" token is a part of
unary expression to avoid breaking an oddly-formatted code like:

    b := get_some_bool()
    if !
       b {…}

One small side-effect of this change is that in code like below:

    Proc_Type :: proc() -> !

    // Some comment
    Some_Other_Type :: enum byte {…}

The "// Some comment" is not associated with "Proc_Type" anymore. In
Odin's standard library this only happens in one place, in
`base/runtime/core.odin`:

    Assertion_Failure_Proc :: #type proc(prefix, message: string, loc: Source_Code_Location) -> !

    // Allocation Stuff
    Allocator_Mode :: enum byte {
    	Alloc,
    	…,
    }
2026-03-01 14:49:24 +01:00
..
2025-03-18 15:39:18 +00:00
2023-12-13 12:38:01 +00:00
&&
2024-11-07 15:02:19 +01:00
2025-10-14 19:55:00 +02:00
2026-02-13 15:15:03 +01:00
2026-02-02 10:58:25 +00:00
2025-09-10 19:30:32 +01:00
2021-08-29 15:54:56 +02:00
2025-10-14 19:55:00 +02:00
2026-02-02 11:15:34 +00:00
2025-10-14 19:55:00 +02:00
2025-11-05 13:30:40 +00:00
2026-02-13 15:15:03 +01:00
2026-02-11 15:33:14 +00:00
2022-12-18 21:17:07 +00:00
2025-09-10 21:16:56 +01:00
2025-08-02 12:33:33 +01:00
2024-04-26 13:25:08 +01:00
2026-01-24 01:26:36 +09:00
2026-02-02 11:25:49 +00:00
2023-09-11 23:36:39 +01:00
2023-12-13 12:38:01 +00:00
2023-08-19 12:26:59 +01:00
2023-12-13 12:38:01 +00:00
2025-11-05 13:44:14 +00:00
2023-12-13 12:38:01 +00:00