mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
language: Change extern type syntax
Use a '$' instead of a '.' to indicate a type provided in application code. The reason for the change is to have a consistent "extern" symbol that isn't widely used elsewhere and isn't ambiguous in expressions.
This commit is contained in:
parent
be284de879
commit
0b402db4d5
11 changed files with 41 additions and 13 deletions
5
tests/sample_errors/warn_old_extern.blp
Normal file
5
tests/sample_errors/warn_old_extern.blp
Normal file
|
@ -0,0 +1,5 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
.MyClass {
|
||||
prop: typeof(.MyOtherClass);
|
||||
}
|
2
tests/sample_errors/warn_old_extern.err
Normal file
2
tests/sample_errors/warn_old_extern.err
Normal file
|
@ -0,0 +1,2 @@
|
|||
3,1,8,Use the '$' extern syntax introduced in blueprint 0.8.0
|
||||
4,16,13,Use the '$' extern syntax introduced in blueprint 0.8.0
|
|
@ -7,5 +7,5 @@ Gio.ListStore {
|
|||
}
|
||||
|
||||
Gio.ListStore {
|
||||
item-type: typeof(.MyObject);
|
||||
item-type: typeof($MyObject);
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
.MyComponent component {
|
||||
.MyComponent2 {
|
||||
$MyComponent component {
|
||||
$MyComponent2 {
|
||||
flags-value: a | b;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
.MyComponent component {
|
||||
.MyComponent2 {
|
||||
$MyComponent component {
|
||||
$MyComponent2 {
|
||||
flags-value: "a|b";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -236,6 +236,7 @@ class TestSamples(unittest.TestCase):
|
|||
self.assert_sample_error("two_templates")
|
||||
self.assert_sample_error("uint")
|
||||
self.assert_sample_error("using_invalid_namespace")
|
||||
self.assert_sample_error("warn_old_extern")
|
||||
self.assert_sample_error("widgets_in_non_size_group")
|
||||
|
||||
def test_decompiler(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue