mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 10:50:00 +00:00
Parser: Don't parse everything as a component
The old parser always try first to find `Foo :=` from the old syntax so it would error saying it expect an identifier or `:=` But if we don't find a component, don't try to parse it as a component too early This way we get better error and better auto-completions
This commit is contained in:
parent
530fbf586c
commit
ee9f730a6d
4 changed files with 10 additions and 4 deletions
|
@ -2,4 +2,4 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||
|
||||
export -
|
||||
// ^error{expected Identifier}
|
||||
// ^error{Parse error: expected a top-level item such as a component, a struct, or a global}
|
||||
|
|
|
@ -7,4 +7,4 @@ export TestCase := Window {
|
|||
// ^error{expected ':'}
|
||||
// ^^error{Parse error}
|
||||
}
|
||||
//^error{expected Identifier}
|
||||
//^error{Parse error: expected a top-level item such as a component, a struct, or a global}
|
||||
|
|
|
@ -14,7 +14,7 @@ export TestCase := Rectangle {
|
|||
border: 42;
|
||||
}
|
||||
]
|
||||
// ^error{expected Identifier}
|
||||
// ^error{Parse error: expected a top-level item such as a component, a struct, or a global}
|
||||
|
||||
transitions [
|
||||
in pressed: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue