Skip to content

Panic on enum syntax error #1536

@volsa

Description

@volsa

The compiler panics, when using an equal (=) instead of an assignment (:=) operator in an enum type definition. For example

TYPE State:
(
    Idle := 0,
    Running = 1, // This should be :=
);
END_TYPE

will panic in the pre-processor with the following message

thread 'main' panicked at compiler/plc_ast/src/pre_processor.rs:81:61:
expected assignment
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace                 

We should catch these as part of a syntax error in the parser.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions