Document and enable the in / out keywords with the old component syntax (#1879)

But it still defaults to `in-out`
This commit is contained in:
Olivier Goffart 2022-11-21 18:41:35 +01:00 committed by GitHub
parent 59d3a69688
commit d2ade4fd98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 8 deletions

View file

@ -336,12 +336,7 @@ fn parse_callback_declaration(p: &mut impl Parser) {
/// ```
fn parse_property_declaration(p: &mut impl Parser) {
let checkpoint = p.checkpoint();
let mut reported_experimental = false;
while matches!(p.peek().as_str(), "in" | "out" | "in-out" | "in_out" | "private") {
if !reported_experimental && !super::enable_experimental() {
p.error("the input/output keywords are experimental, set `SLINT_EXPERIMENTAL_SYNTAX` env variable to enable experimental syntax. See https://github.com/slint-ui/slint/issues/1750");
}
reported_experimental = true;
p.consume();
}
if p.peek().as_str() != "property" {