slint/internal/compiler/tests/syntax/parse_error/if0.slint
Olivier Goffart ee9f730a6d 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
2023-04-17 07:58:18 +02:00

10 lines
328 B
Text

// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
export TestCase := Window {
if //
Foo { }
// ^error{expected ':'}
// ^^error{Parse error}
}
//^error{Parse error: expected a top-level item such as a component, a struct, or a global}