Commit graph

138 commits

Author SHA1 Message Date
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
Olivier Goffart
d22c8bd3df Janitor: Bump rowan version 2022-01-31 15:23:38 +01:00
James Blacklock
7ad1ba209d Add support for array index expressions
This is a squash of the changes in
https://github.com/sixtyfpsui/sixtyfps/pull/605
2022-01-14 13:38:25 +01:00
Olivier Goffart
b078fffc44 Parser: allow . to access member after any expression
Before we would only allow `foo.bar` where `foo` was an identifier.
Now we also allow more complex expression such as `"foo".bar` or `(123 + foo).bar`
(in the parser)
In particular, this will allow to get the member of objects returned by functions
or, in the future, part of arrays
2022-01-13 17:49:16 +01:00
Tobias Hunger
bfca0e3573 Mass update copyright messages to be more REUSE compliant 2021-12-22 10:06:12 +01:00
Olivier Goffart
d5ad9ebe0e Improve the macro from the previous commit
I have the feeling that having less 'write!' will lead to better code
2021-10-06 09:02:43 +02:00
Olivier Goffart
521bf192f8 Improve error message for parse error
print the literal token symbol instead of the internal token name
2021-10-06 08:54:14 +02:00
Olivier Goffart
f69ad502d6 Update rowan version 2021-09-04 10:50:06 +02:00
Olivier Goffart
c25538c982 Normalize identifiers to - instead of _
As a result
 - The error messages will now show the error with `-` instead of `_`
 - The LSP will auto-complete with -
 - The interpreter's list of properties will list the property with '-'
   (but we made the change so that set_property, get_property, and so on
   work also if passed a '-')
2021-08-10 22:21:01 +02:00
Tobias Hunger
e5bdeaa804 Janitor: Remove unnecessary & 2021-07-07 08:42:28 +02:00
Tobias Hunger
39984b27db Janitor: Fix spelling in comments 2021-07-03 15:49:43 +02:00
Olivier Goffart
13bd828b96 Update license date 2021-07-02 15:55:54 +02:00
Tobias Hunger
13d7f5e7bd Janitor: Fix typos in comments and user-facing strings
Also adapt tests for error messages containing the fixed strings.

No behavior change is intended!
2021-06-28 08:32:25 +02:00
Olivier Goffart
42c25248a8 Allow to give a name to for and if 2021-06-18 16:40:40 +02:00
Olivier Goffart
7384d334c1 WIP: parse callback aliases 2021-06-07 20:40:36 +02:00
Olivier Goffart
715d38903f Allow to omit the type of aliases 2021-06-07 10:48:09 +02:00
Olivier Goffart
01c00251b0 Move parsing code for elements to its own modules 2021-06-07 10:48:09 +02:00
Olivier Goffart
fed73bbd67 syntax_tests: Try to build the object_tree::document even in case of parse error
To make sure it doesn't panic.

Also fix a bunch of errors that were causing panic bacause missing elements in the tree

The goal it to be able to generate a best effort node required for the LSP
2021-04-14 11:46:49 +02:00
Olivier Goffart
84e0b24550 Some refactoring of the syntax_nodes module
Ensure that the node always contains the write kind by panicking
if it doesn't.

Add some documentation for the macro that declares them
2021-04-14 11:46:49 +02:00
Simon Hausmann
a92c9196eb Typeloader cleanup
There are currently two places where we resolve relative file names,
once in the import handling and once when processing @image-url.

Both places called first `loader.find_file_in_include_path` and then `resolve_import_path`,
which this patch combines into one function.

That will make it easier (and less error-prone) for future call sites.
2021-04-14 09:01:52 +02:00
Simon Hausmann
cbf2b51670 Allow empty imports
Allow import "blah.60" or, more likely in the future, import "foo.ttf".
2021-04-14 09:01:49 +02:00
Olivier Goffart
7a65f31cc1 the source_file is not optional 2021-04-13 17:26:24 +02:00
Olivier Goffart
84501e630a Rename SyntaxNodeWithSourceFile to SyntaxNode
Same for SyntaxToken
2021-04-13 17:10:56 +02:00
Olivier Goffart
cb06394685 Remove some more use of SyntaxNode and SyntaxToken 2021-04-13 17:10:56 +02:00
Olivier Goffart
5c795e7bab Use SyntaxNodeWithSourceFile everywhere instead of SyntaxNode 2021-04-13 17:10:56 +02:00
Olivier Goffart
81ebb2177e LSP: completion of properties 2021-04-07 23:55:46 +02:00
Olivier Goffart
72f4827617 Fix message in assert not being a string literal
assert! does take a format string anyway so one need not to use format! as the
message of an assert. (That's better since then a string is not allocated when
the assert is going to succeed anyway
2021-03-25 17:08:15 +01:00
Olivier Goffart
cae88f0823 Create a Diagnostic quen the main .60 file can't be loaded 2021-03-15 11:44:20 +01:00
Olivier Goffart
730b1ccff2 Refactor diagnostic: Merge BuildDiagnostic and FileDiagnostic 2021-03-12 19:32:50 +01:00
Olivier Goffart
968dfaae87 Put what is the FileDiagnostics into the SourceFile so the SourceFile has the content 2021-03-11 16:23:46 +01:00
Olivier Goffart
7c48bcdd4c Add the source file getter to the Spanned trait, and remove SpannedWithSourceFile 2021-03-11 14:09:55 +01:00
Olivier Goffart
2d12e118ac Resolve linear gradients 2021-02-01 14:25:27 +01:00
Olivier Goffart
8ab713c681 Parse @linear-gradient(...) 2021-02-01 14:25:27 +01:00
Olivier Goffart
82aa658cef Update rowan 2021-01-28 15:37:01 +01:00
Olivier Goffart
3b968c8a8e Fixup previous commit
the $children replacement shouldn't have replaced rust code
2021-01-28 11:58:43 +01:00
Olivier Goffart
07df517473 Replace $children with @children 2021-01-28 11:55:08 +01:00
Olivier Goffart
bb4212f0aa Remove bang macro support 2021-01-28 11:49:24 +01:00
Olivier Goffart
5debc08f98 Parse @image-url 2021-01-28 11:49:24 +01:00
Simon Hausmann
16a75a2ff8 Parse return statements 2021-01-25 15:32:00 +01:00
Olivier Goffart
8dc79699de String template concatenation
Currently not supported in the sixtyfps macro
2021-01-18 16:09:58 +01:00
Olivier Goffart
882bd7ddb7 Lex template string 2021-01-18 14:43:54 +01:00
Olivier Goffart
7fcb49bef1 Implement Go to definition for elements 2020-12-23 15:15:53 +01:00
Olivier Goffart
0d2d48be4f Rename "signal" to "callback" 2020-12-18 09:51:01 +01:00
Olivier Goffart
7f78bea8b5 Fix a bunch of cargo clippy warnings in the compiler 2020-12-07 12:54:38 +01:00
Olivier Goffart
8b10414451 Parse signal return type
(currently does nothing with it)
2020-12-01 18:47:49 +01:00
Simon Hausmann
6fba6aca56 Consistency fix for transitions API
Use "in" and "out" instead of "to" and "out".
2020-12-01 11:18:47 +01:00
Olivier Goffart
281a744e86 Load the builtin from a fake .60 file 2020-11-04 16:56:35 +01:00
Simon Hausmann
ef18e89e4f Typeloader cleanup
Split the document loading related part of load_dependency into a
separate ensure_document helper function.
2020-11-04 14:16:58 +01:00
Olivier Goffart
11e55dd8d2 String -> Float conversions 2020-11-03 15:19:58 +01:00
Olivier Goffart
980aceded6 Parser: put the component name in a DeclaredIdentifier node
that way we will be able to have the global keyword as another identifier there
2020-10-28 07:18:24 +01:00