Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c285049
compiler: Introduce ElementType::Interface
0x6e Oct 18, 2025
821ed79
compiler: `interface` is a valid top-level item keyword
0x6e Oct 18, 2025
dc44f4d
compiler: An interface excludes the same content as a global
0x6e Nov 21, 2025
f6a3d67
compiler: An interface can have public properties
0x6e Oct 22, 2025
1a56ac8
compiler: `implements` is a valid keyword
0x6e Nov 21, 2025
8336cb0
compiler: Cannot "implement" non-interface components
0x6e Nov 24, 2025
fd2c9e9
compiler: interface properties are exposed
0x6e Nov 26, 2025
4149a45
Move existing interface syntax texts to syntax/interfaces
0x6e Nov 26, 2025
11fd152
compiler: Add uses specified as valid new component syntax
0x6e Nov 26, 2025
c862c74
compiler: uses statements expose interface properties from child
0x6e Nov 28, 2025
9c3cef2
compiler: emit errors for invalid interfaces in uses statements
0x6e Nov 28, 2025
25d5c30
compiler: emit an error when the child specified in a uses statement …
0x6e Nov 28, 2025
54d3e18
compiler: verify that external interfaces can be implemented
0x6e Nov 28, 2025
435739f
compiler: verify that renamed components and interfaces can be used
0x6e Nov 28, 2025
16d15ab
compiler: verify that the child component implements the interface
0x6e Nov 28, 2025
e889d05
compiler: do not allow interface properties to be overridden
0x6e Nov 28, 2025
735346b
compiler: do not permit interfaces to be used if they would override …
0x6e Nov 28, 2025
d0aa690
compiler: emit an error if a uses statement attempts to override an e…
0x6e Nov 28, 2025
f6bedb8
compiler: 'interface', 'implements' and 'uses' are experimental features
0x6e Nov 29, 2025
f27c6f4
compiler: parse_uses_identifier returns a valid SyntaxKind::UsesIdent…
0x6e Dec 3, 2025
7788b9d
compiler: simplify `UsesSpecifier -> UsesSpecifierList -> UsesIdentif…
0x6e Dec 3, 2025
848c0a9
lsp: Ensure that uses statements are not broken
0x6e Dec 4, 2025
017b1a9
compiler: ':=' to declare an interface is an error
0x6e Dec 5, 2025
2c740dc
compiler: private properties in an interface are an error
0x6e Dec 5, 2025
56d9063
Update insterface syntax tests
0x6e Dec 5, 2025
6ddee1a
compiler: check experimental features before emitting more specific i…
0x6e Dec 5, 2025
5f1c286
compiler: Simplify UsesStatement
0x6e Dec 5, 2025
01df983
compiler: clean up ElementType::Interface TODO comment
0x6e Dec 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/compiler/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ pub fn for_each_const_properties(
ElementType::Builtin(_) => {
unreachable!("builtin element should have been resolved")
}
ElementType::Global | ElementType::Error => break,
ElementType::Global | ElementType::Interface | ElementType::Error => break,
}
}
for c in all_prop {
Expand Down
8 changes: 7 additions & 1 deletion internal/compiler/langtype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,8 @@ pub enum ElementType {
Error,
/// This should be the base type of the root element of a global component
Global,
/// This should be the base type of the root element of an interface
Interface,
}

impl PartialEq for ElementType {
Expand All @@ -413,7 +415,9 @@ impl PartialEq for ElementType {
(Self::Component(a), Self::Component(b)) => Rc::ptr_eq(a, b),
(Self::Builtin(a), Self::Builtin(b)) => Rc::ptr_eq(a, b),
(Self::Native(a), Self::Native(b)) => Rc::ptr_eq(a, b),
(Self::Error, Self::Error) | (Self::Global, Self::Global) => true,
(Self::Error, Self::Error)
| (Self::Global, Self::Global)
| (Self::Interface, Self::Interface) => true,
_ => false,
}
}
Expand Down Expand Up @@ -615,6 +619,7 @@ impl ElementType {
ElementType::Native(_) => None, // Too late, caller should call this function before the native class lowering
ElementType::Error => None,
ElementType::Global => None,
ElementType::Interface => None,
}
}
}
Expand All @@ -627,6 +632,7 @@ impl Display for ElementType {
Self::Native(b) => b.class_name.fmt(f),
Self::Error => write!(f, "<error>"),
Self::Global => Ok(()),
Self::Interface => Ok(()),
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion internal/compiler/namedreference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ impl NamedReference {
ElementType::Native(n) => {
return n.properties.get(self.name()).is_none_or(|pi| !pi.is_native_output());
}
crate::langtype::ElementType::Error | crate::langtype::ElementType::Global => {
crate::langtype::ElementType::Error
| crate::langtype::ElementType::Global
| crate::langtype::ElementType::Interface => {
return true;
}
}
Expand Down
Loading
Loading