mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-01 20:31:27 +00:00
Adding support for (optional) trailing commas like this:
import {
Foo,
Bar,
} from "foobar.slint";
This way it's more convenient to keep component imports sorted and
leads to smaller diffs when adding more components to the end of the
import statement.
ChangeLog: Allow trailing comma in import statements
Closes #4922
36 lines
997 B
Text
36 lines
997 B
Text
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
|
|
|
//include_path: ../../helper_components
|
|
import { UseStruct , ExportedStruct, ExportEnum , } from "export_structs.slint";
|
|
TestCase := Rectangle {
|
|
property <ExportedStruct> exp: { d: 3001, e: {a: 2001} };
|
|
u := UseStruct {
|
|
exp: { d: 3002, e: {a: 2002} };
|
|
nexp: { b: 3003, c: {a: 2003} };
|
|
}
|
|
out property<bool> xx: ExportEnum.Hello != ExportEnum.Bonjour;
|
|
property<int> p1: u.nexp.c.a;
|
|
}
|
|
/*
|
|
|
|
```cpp
|
|
auto handle = TestCase::create();
|
|
const TestCase &instance = *handle;
|
|
assert_eq(instance.get_p1(), 2003);
|
|
assert_eq(instance.get_exp().e.a, 2001);
|
|
```
|
|
|
|
```rust
|
|
let instance = TestCase::new().unwrap();
|
|
assert_eq!(instance.get_p1(), 2003);
|
|
assert_eq!(instance.get_exp().e.a, 2001);
|
|
```
|
|
|
|
```js
|
|
var instance = new slint.TestCase({});
|
|
assert.equal(instance.p1, 2003);
|
|
assert.equal(instance.exp.e.a, 2001);
|
|
```
|
|
|
|
*/
|