PLC-lang/rusty

Improve `DataType` `SourceLocation`

开放

#1,343 创建于 2024年10月18日

 (0 条评论) (0 个反应) (0 位负责人)Rust (71 个派生)auto 404
buggood first issuemedium-priorityvalidation

仓库指标

星标
 (351 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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)'

贡献者指南