Commit graph

29 commits

Author SHA1 Message Date
U. Bruhin
a5ec77ac99
Allow trailing comma in import statements (#8223)
Adding support for (optional) trailing commas like this:

    import {
        Foo,
        Bar,
    } from "foobar.slint";

This way it's more convenient to keep component imports sorted and
leads to smaller diffs when adding more components to the end of the
import statement.

ChangeLog: Allow trailing comma in import statements

Closes #4922
2025-04-21 17:24:18 +02:00
Olivier Goffart
6c81d5069e Fix parsing of unfinished import statement
Fix #6588

Note for the test: parse error at the end of the file are actually
reported at offset 0. Use a trick to add more `^` at the beginning to
mean that.
(Offset 0 is actually offset 1 as the column starts at 1)
2024-10-22 09:35:46 +02:00
Olivier Goffart
66370b6bda
Add export { ... } from "....slint"; syntax. (#5533) 2024-07-03 12:50:40 +02:00
Aurindam Jana
3523e86359
Simplify commercial license (#3063)
Base the commercial license on the Royalty-free license adding clauses pertaining to the fees.
2024-05-31 14:06:17 +02:00
Aurindam Jana
9a3aa265d5
Update Royalty-free license (#5257)
Add clarification that Application may not expose Slint APIs.
2024-05-31 10:53:19 +02:00
Aurindam Jana
0cfeec1a31
Update Slint Community License (#4994)
Updated the version from 1.1 to 1.2 
Renamed the header to "Slint Royalty-free Desktop, Mobile, and Web Applications License"
Added definition of "Mobile Application" and grant of right
Moved "Limitations" to 3rd section and "License Conditions - Attributions" to 2nd section
Added flexibility to choose between showing "MadeWithSlint" as a dialog/splash screen or on a public webpage
Moved the para on copyright notices to section under "Limitations"
2024-04-15 15:18:55 +02:00
Aurindam Jana
5a4a7fee63
Update royalty free license to 1.1 (#2994) 2023-07-10 10:12:11 +02:00
Tobias Hunger
e02c360000 Clippy polish 2023-06-28 14:22:30 +02:00
Olivier Goffart
fdec5960bd Support for @rust-attr on enums 2023-06-19 22:40:49 +02:00
Olivier Goffart
11dea135f7 Domain: slint-ui.com -> slint.dev 2023-06-16 10:55:08 +02:00
Aurindam Jana
039e54a5de
Add royalty free license to files except examples and docs (#2888) 2023-06-15 11:20:50 +02:00
Olivier Goffart
ac6f473a64 WIP: support for enum in slint
Parser and interpreter part
2023-06-12 13:02:14 +02:00
Amirhossein Akhlaghpour
3a4f3c61d5
Add @rust-attr on scturct (#2785)
Fixes: #2660
2023-06-05 16:29:55 +02:00
Olivier Goffart
875a7ea179 Parser: Nicer error when extra top-level semicolon
Recover from extra semicolon
2023-04-17 15:13:20 +02:00
Olivier Goffart
a7b8bafdf9 Ensure completion in the document in case of parse error or empty document
Every token must be part of a document, including the EOF,
otherwise completion don't work at the end of the document.
2023-04-17 07:58:18 +02:00
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
Olivier Goffart
40922874fa parser: don't parse error on empty import statement
Report the error later when loading the import.
That way, we get a more complete AST for auto-completion
2023-04-17 07:58:18 +02:00
Olivier Goffart
4f00f268a5 Make the old syntax a warning 2023-02-14 12:38:39 +01:00
Olivier Goffart
a0d057b8b8 Enable the new syntax by default 2023-01-07 14:18:10 +01:00
Olivier Goffart
aeed3b48fc Parser: fix parsing of "public function" in release mode
`consume()` does not advance whitespace, while `peek()` does.  And the
`peek()` in the debug_assert meant that the behavior was different in
release and debug mode.
Use `expect` instead of consume as it skip over white space
2022-12-15 12:52:21 +01:00
Simon Hausmann
8faf57fa40 Minor fix to export * from "blah" parsing
Use the star token directly.
2022-12-09 11:05:08 +01:00
Simon Hausmann
03fe599890 Add support for re-exporting modules
Use `export * from "somewhere.slint"` to avoid having to repeat all the
types of an existing module in order to re-export all of the types.
2022-12-09 11:05:08 +01:00
Olivier Goffart
c1c52a2b86 Make the test pass without defining the SLINT_EXPERIMENTAL_SYNTAX env variable 2022-11-21 22:01:52 +01:00
Simon Hausmann
59d3a69688
Fix support for multiple import statements from the same path (#1868)
Importing multiple types from the same file with multiple import statements would produce an error.
2022-11-21 15:37:38 +01:00
Olivier Goffart
f055afd2de New syntax: allow to create component without base 2022-10-26 18:09:57 +02:00
Olivier Goffart
69b15043d4 Gate the new syntax with an environment variable 2022-10-20 08:02:26 +02:00
Olivier Goffart
a3ba7bf78a syntax_updater: Continue new syntax, add it to the parser
This re-adds inheritence with the "inherits" keyword
2022-10-20 08:02:26 +02:00
Tobias Hunger
4230ac2572
Update copyright information to reflect name change
Also run resue over the codebase and fix complaints from that tool.
2022-02-09 10:27:47 +01:00
Tobias Hunger
e6b24bceec [reorg]: Set up and populate the internal directory
Move "internal" crates into the `internal` directory. This first batch
includes most of sixtyfps_runtime but leaves the rendering backends
alone for now.

pre-commit applied some cleanups to the moved files:
 - Consistent newline at end of file policy
 - trimming trailing whitespace
 - Formatting Cargo.toml files.
2022-01-31 16:00:50 +01:00
Renamed from sixtyfps_compiler/parser/document.rs (Browse further)