PLC-lang/rusty

Improve `DataType` `SourceLocation`

オープン

#1,343 opened on 2024/10/18

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)Rust (71 件のフォーク)auto 404
buggood first issuemedium-priorityvalidation

Repository metrics

Stars
 (351 個のスター)
PR merge metrics
 (PR metrics pending)

説明

When parsing data-types, we include the initializer in the data-types source locations, leading to confusing error messages when converting the location to a slice:

FUNCTION main: DINT
VAR
    x: REF_TO STRING;
    y: REF_TO DINT := REF(x);
END_VAR
END_FUNCTION

error[E037]: Invalid assignment: cannot assign '__main_x' to 'REF_TO DINT := REF(x)'
  ┌─ target\demo.st:4:23
  │
4 │     y: REF_TO DINT := REF(x);
  │                       ^^^^^^ Invalid assignment: cannot assign '__main_x' to 'REF_TO DINT := REF(x)'

コントリビューターガイド