lingua-franca icon indicating copy to clipboard operation
lingua-franca copied to clipboard

Cargo dependency names are parsed as identifiers

Open jhaye opened this issue 2 years ago • 3 comments

When defining the Rust target with a cargo dependency, that dependency's name is parsed as an identifier. This means that if it contains a keyword, LFC throws a parsing error.

For example, this target config:

target Rust {
    build-type: Release,
    cargo-features: ["cli"],
    cargo-dependencies: {
        cpu-time: "1",
    }
};

Throws the following error:

'time' is a reserved keyword which cannot be used as an identifier.

I'm not familiar with the parser, so I don't know how to fix this.

jhaye avatar May 26 '22 11:05 jhaye

Maybe @lhstrh can comment? But I am afraid that the only real fix for this is not using xtext...

cmnrd avatar Jun 20 '22 15:06 cmnrd

I don't know if it works, but one idea could be to use Token instead of ID for the keys.

cmnrd avatar Jun 20 '22 15:06 cmnrd

See #1238.

lhstrh avatar Jun 20 '22 22:06 lhstrh