PLC-lang / rusty

Structured Text Parser and LLVM Frontend
GNU Lesser General Public License v3.0
223 stars 53 forks source link

fix: Parse REFERENCE TO STRING initializer #1267

Closed volsa closed 3 months ago

volsa commented 3 months ago

Previously a string REFERENCE TO pointer variable would fail to parse when a REF= operator was present. This commit fixes this by checking if a REF= operator can be consumed when parsing a STRING variable (line). Specifically the parser should now be able to parse the following without any issues

FUNCTION main
    VAR
        foo : REFERENCE TO STRING REF= bar;
        bar : STRING;
    END_VAR
END_FUNCTION