Commit graph

70 commits

Author SHA1 Message Date
Olivier Goffart
4981c3ca75 Some check for the two way bindings 2020-09-23 14:06:08 +02:00
Olivier Goffart
bfe2bf2478 Ability to read properties of a struct 2020-09-17 13:53:00 +02:00
Olivier Goffart
a6504ee61b Start implementing some code that passes argument to functions and signals 2020-09-08 14:37:44 +02:00
Olivier Goffart
e10ed650ee Lookup of signal argument within a signal handler 2020-09-08 12:12:01 +02:00
Olivier Goffart
637a0e792c Some more progress in signal connection with arguments 2020-09-07 18:49:38 +02:00
Olivier Goffart
9f026c820d Parse declaration of signal with arguments 2020-09-07 17:41:24 +02:00
Olivier Goffart
9fbb40d91b Start working on a debug statement 2020-09-03 19:10:07 +02:00
Olivier Goffart
f5032ab0f8 Allow array as property
Also fix the lookup rules for the model property in a repeated element
2020-09-03 18:05:20 +02:00
Olivier Goffart
c46183a279 Allow all CSS colors
issue #53
2020-09-03 17:18:20 +02:00
Olivier Goffart
159d8b615a Some adjustment to the examples in langref 2020-09-01 14:27:00 +02:00
Patrick José Pereira
b990cccf60 Fix typo in sixtyfps_compiler/passes/resolving
Move typo expresion to expression

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2020-08-31 14:42:27 +02:00
Olivier Goffart
58cdaeb8dd Update license header to mention that commertial option are available 2020-08-26 13:23:42 +02:00
Simon Hausmann
2823f32692 Apply license headers to all non-binary/non-json sources 2020-08-17 17:55:20 +02:00
Simon Hausmann
fcc819e395 Add support for enums to the compiler
This replaces the duplicated text alignment enums
2020-08-07 13:15:43 +02:00
Simon Hausmann
aecf6a8878 Center text in buttons in the demo and gallery
This adds horizontal_alignment/vertical_alignment properties, along with
width/height to Text.

This still uses a hard-coded enumeration in the compiler, which is meant
to go away in favor of general enum support.
2020-08-07 10:02:52 +02:00
Olivier Goffart
2518af41b1 Fix for in a declared component 2020-08-04 18:51:39 +02:00
Olivier Goffart
0199b70cea if statements 2020-08-04 17:36:20 +02:00
Olivier Goffart
283387bc44 Add the self and parent implicit id 2020-08-04 15:58:40 +02:00
Olivier Goffart
5f38f03a1b Test setting signal handler and a few fix to make it work
We were not parsing CodeBlock node from the signal handler correctly,
we wer eonly taking the first expression instead of the whole codeblock

In JS, emitting signal before the show() did not update the GLOBAL_CONTEXT
needed to emit signals defined in JS
2020-08-03 15:01:10 +02:00
Olivier Goffart
feec73674f Start implementing easing curve 2020-07-29 15:19:41 +02:00
Olivier Goffart
6f30c21a98 Fix panic when connecting a non existing signal 2020-07-24 11:33:00 +02:00
Olivier Goffart
232848de9e Make sure that there is only one error reported when assigning to invalid
This also start parsing assignment ('=') as a self assignement
but the code generation is not yet implmented
2020-07-24 11:33:00 +02:00
Simon Hausmann
a9b0d84a72 Improve source file propagation
Instead of doing the SyntaxNodeWithSourceFile construction as late as
possible (in Document::from_node), we can do it as early as possible.
That'll reduce the chances of missing out the source file and prepares
for dependency loading just based on a SNWS :)

This also makes the source_file optional in the SNWS, but that's
consistent with what the diagnostics expect.
2020-07-22 16:10:02 +02:00
Olivier Goffart
bdea34d8c4 Generate an expression for states 2020-07-21 19:01:48 +02:00
Simon Hausmann
abe6888296 Collect proper per-file diagnostics in the compiler passes
When creating diagnostics in the passes, report them correctly in the
build diagnostics. There's no automated test yet, but it was manually
verified.
2020-07-21 15:27:41 +02:00
Simon Hausmann
26528a8e9c Keep track of the source file in the syntax tree
When going from the plain rowan::SyntaxNode tree to the syntax_nodes::*
elements, attach the source file and keep track of it from that point
on. That'll pave the way for proper multi-file diagnostics generated
later on from the passes, where we store syntax_nodes::* types.
2020-07-21 15:27:41 +02:00
Simon Hausmann
01fa05eeff Generalize maybe_convert_to
We don't need a concrete node, just the spanned trait impl. This simplifies the call
sites a little and reduces the noise in the upcoming patches.
2020-07-21 15:27:41 +02:00
Simon Hausmann
a5eb763c54 Eliminate another span() call site 2020-07-21 15:27:41 +02:00
Simon Hausmann
f8c0eb0bd6 Prepare for passing passing more information from syntax node to diagnostics
Let the bulk of the push_error() calls take a Spanned trait impl, so
that we can pass node on the call sites. Then when later change the
underyling trait to pass something that can also provide the source file
and we don't have to change all call sites again.
2020-07-20 16:01:15 +02:00
Simon Hausmann
4ba2425011 Use a HashSet instead of a HashMap
As pointed out by Olivier, it's possible to get the pointer back by
using ByAddress' Deref implementation.
2020-07-20 11:29:53 +02:00
Simon Hausmann
f2d6d65cd8 Fix a bug with external types using expressions
Types from external files need to be included in the inlining.
2020-07-20 10:48:53 +02:00
Simon Hausmann
e914715d88 Rename Diagnostics to FileDiagnostics
As this structure holds the diagnostics just for one file.
2020-07-16 18:25:42 +02:00
Simon Hausmann
0f0055b87c Cleanup in the expression resolution pass
It turns out that we don't need the type registry :-)
2020-07-15 13:28:56 +02:00
Simon Hausmann
5b43962bb2 Split up TypeRegistry
For a .60 files the locally defined components are now stored in a separate
per-document TypeRegistry instance that falls back to the global registry
for lookups.
2020-07-15 13:09:43 +02:00
Olivier Goffart
24033ecdc3 Support for logical_lenght type 2020-07-15 11:53:19 +02:00
Simon Hausmann
719bff4eca Minor cleanup
Don't require a mutable type registry for the compiler passes.
2020-07-15 11:25:28 +02:00
Olivier Goffart
8e7e3aaa7a Make the length its own unit 2020-07-14 17:45:03 +02:00
Olivier Goffart
952ddda7c4 Force duration to have an unit 2020-07-14 16:18:12 +02:00
Olivier Goffart
c30aa370f3 Parse units
They currently have no real meaning
2020-07-14 11:35:45 +02:00
Simon Hausmann
4c0755d6cc Change the way boolean literals are implemented
Instead of catching them at parsing time, catch them when trying to convert a qualified name node into an expression.
2020-07-07 22:53:35 +02:00
Simon Hausmann
22d838ffae Add support for true and false boolean literals 2020-07-07 22:11:41 +02:00
Olivier Goffart
009addf9b4 Logical operations and comparisons and unary operators 2020-06-29 18:40:37 +02:00
Olivier Goffart
c4b1feeea0 Parse Equality opreration
(Code generation still missing)
2020-06-29 18:40:37 +02:00
Olivier Goffart
19a8559d3f WIP: Conditional elements
The parsing part is implemented, but not the backend as it requires
non-const "models"
2020-06-29 15:03:09 +02:00
Simon Hausmann
3d85cb7f23 Add basic support for property animations to the rust generator
Setting values on animated properties now results in set_animated_value
being called on the property instead of set, and the animation data is
passed on the spot.
2020-06-24 17:54:25 +02:00
Olivier Goffart
f744fcccab Lookup within objects properties
Generated code not yet implemented
2020-06-22 17:35:01 +02:00
Olivier Goffart
1bb8d94ab8 Support array for model in rust and in the interpreter 2020-06-19 19:46:59 +02:00
Olivier Goffart
6238d0d14f Prepare for the ability to access the model
Add an expression type for the access of the model variable from a repeater
2020-06-19 13:46:55 +02:00
Olivier Goffart
864e74601d Add a Model type for
I guess in the future we want to make model a type that knows its inside
2020-06-19 13:13:19 +02:00
Olivier Goffart
be8f127317 Object and array parsing 2020-06-18 15:22:30 +02:00