lingua-franca
lingua-franca copied to clipboard
Cargo dependency names are parsed as identifiers
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.
Maybe @lhstrh can comment? But I am afraid that the only real fix for this is not using xtext...
I don't know if it works, but one idea could be to use Token
instead of ID
for the keys.
See #1238.