1 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
2 | // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0 |
3 | |
4 | export component SuperSimple { |
5 | property <image> i1: @image-url("hello.png" ); |
6 | property <string> path; |
7 | property <image> i2: @image-url(path); |
8 | // ^error{@image-url must contain a plain path as a string literal} |
9 | property <image> i3: @image-url("/home/\{path}.png" ); |
10 | // ^error{@image-url must contain a plain path as a string literal, without any '\\\{}' expressions} |
11 | property <image> i4: @image-url("/home/" + path + ".png" ); |
12 | // ^error{Expected '\)' or ','} |
13 | property <image> i5: @image-url(path + ".png" ); |
14 | // ^error{@image-url must contain a plain path as a string literal} |
15 | property <image> i6: @image-url; |
16 | // ^error{Syntax error: expected '\('} |
17 | property <image> i7: @image-url("foo" , "bar" ); |
18 | // ^error{Expected 'nine-slice\(...\)' argument} |
19 | property <image> i8: @image-url("foo" , xyz(abc)); |
20 | // ^error{Expected 'nine-slice\(...\)' argument} |
21 | property <image> i9: @image-url("foo" , nine-slice(abc)); |
22 | // ^error{Expected number literal or '\)'} |
23 | property <image> i10: @image-url("foo" , nine-slice(1 2 3)); |
24 | // ^error{Expected 1 or 2 or 4 numbers} |
25 | property <image> i11: @image-url("foo" , nine-slice()); |
26 | // ^error{Expected 1 or 2 or 4 numbers} |
27 | property <image> i12: @image-url("foo" , nine-slice(1 2 3 4 5)); |
28 | // ^error{Expected 1 or 2 or 4 numbers} |
29 | property <image> i13: @image-url("foo" , nine-slice(1 2 foobar 4 5)); |
30 | // ^error{Expected number literal or '\)'} |
31 | property <image> i14: @image-url("foo" , nine-slice); |
32 | // ^error{Syntax error: expected '\('} |
33 | property <image> i15: @image-url("foo" , nine-slice,); |
34 | // ^error{Syntax error: expected '\('} |
35 | property <image> i16: @image-url("foo" , nine-slice 42 42); |
36 | // ^error{Syntax error: expected '\('} |
37 | property <image> i17: @image-url("foo" , nine-slice(1px)); // error reported later |
38 | property <image> i18: @image-url("foo" , nine-slice(1%)); // error reported later |
39 | property <image> i19: @image-url("foo" , nine-slice(1, 2)); |
40 | // ^error{Arguments of nine-slice need to be separated by spaces} |
41 | property <image> i20: @image-url("foo" , nine-slice(2 + 3 )); |
42 | // ^error{Expected number literal or '\)'} |
43 | property <image> i21: @image-url("foo" , nine-slice(2 -3 )); |
44 | // ^error{Expected number literal or '\)'} |
45 | property <image> i22: @image-url("foo" , nine-slice(-2)); |
46 | // ^error{Expected number literal or '\)'} |
47 | property <image> i22: @image-url("foo" , nine-slice(123456789)); |
48 | } |
49 | |