DanielGavin / ols

Language server for Odin
MIT License
382 stars 58 forks source link

Incorrect syntax error when assigning proc to struct variable #317

Closed parkerlamb closed 4 months ago

parkerlamb commented 4 months ago

ols incorrectly raises a syntax error when assigning a proc to a struct variable.

Example:

package test

import "core:fmt"

main :: proc() {
    MyStruct :: struct {
        do_action: proc()
    }

    my_struct := MyStruct {
        do_action = proc() {
            fmt.println("Action called!")
        }
    }

    my_struct.do_action()
}

ols says expected '}' after compound literal, got 'newline' on line 13, while running the same code with odin correctly prints Action called!.

ols version: v0.1.27 (vscode) odin version: dev-2024-02:539cec74

DanielGavin commented 4 months ago

This is caused by and issue with core:odin/parser not being in sync with the odin compiler. It has to be fixed in Odin.