Olivier Goffart
a39a72b240
Fix the syntax_tests to actually match the regexp
...
The error regexp was not properly matched, being effectively ignoed.
Fixed that and the tests.
Added self tests to syntax_tests.
2020-05-26 11:24:37 +02:00
Olivier Goffart
7ba39f0a1c
Make sure that we cannot override a property from the base
2020-05-26 11:23:54 +02:00
Olivier Goffart
4ea78134d8
Recactor the compiler so there are passes
2020-05-26 09:40:36 +02:00
Olivier Goffart
e8e1567975
Make the compiler actualy use the lib rather than re-declaring everything
2020-05-26 09:18:31 +02:00
Olivier Goffart
dee50a6fe8
More fixes to property lookup with components
2020-05-26 08:10:37 +02:00
Olivier Goffart
b12e63de52
Fix lookup of property within component
2020-05-26 07:43:12 +02:00
Simon Hausmann
0932953ac8
Implement property declarations for the C++ backend
2020-05-25 19:13:52 +02:00
Olivier Goffart
5a7a95dbc8
Make sure that we do not recognize ': =' or '= >' as one token
2020-05-25 18:15:06 +02:00
Olivier Goffart
e34ac8c3f4
Get signals and toucharea working on the rust example
2020-05-25 17:41:24 +02:00
Olivier Goffart
905f6c7b15
Fix signal lookup for now
...
Real signal lookup is still not implemented, any identifier for a signal property is considered as a signal
2020-05-25 17:34:38 +02:00
Olivier Goffart
9e4c355fa1
Lookup of quallified id
2020-05-25 17:24:31 +02:00
Simon Hausmann
1efa80882e
Parse initializers for property declarations
2020-05-25 16:42:09 +02:00
Simon Hausmann
b3ee72b6c5
Permit bindings on declared properties
...
At least syntactically :-)
2020-05-25 16:42:09 +02:00
Simon Hausmann
88faafe305
Fix property declaration storage in the object tree
...
We need to maintain an associated data structure to permit checking for
duplicate property declarations.
2020-05-25 16:42:09 +02:00
Simon Hausmann
a55cad05b9
Allow running specific syntax tests
...
By specifying the relative path as a command line argument, it's easier to
debug a specific case in the IDE.
2020-05-25 16:42:09 +02:00
Simon Hausmann
747cf18fcd
Small typo fix
...
(Unkown -> Unknown)
2020-05-25 16:42:09 +02:00
Olivier Goffart
19eca01dff
Lookup of property within the root component
2020-05-25 16:13:17 +02:00
Olivier Goffart
ce657a5b01
Add test for failled lookup
2020-05-25 15:50:34 +02:00
Olivier Goffart
2bc695643d
Fix the type of color
2020-05-25 15:43:19 +02:00
Olivier Goffart
c0a4902240
Rename expressions -> expression_tree
...
there is already an expressions module in the parser
2020-05-25 15:28:37 +02:00
Simon Hausmann
73917187d6
Fix error message for duplicate property bindings
2020-05-25 15:05:11 +02:00
Olivier Goffart
11e5ce5887
Rename the CondeStatement syntax node to BindingExpression
...
This is the right-hand-side of a binding, and it is a pure expression.
Statements will be reserved for signals
2020-05-25 14:58:26 +02:00
Olivier Goffart
1de4eb476b
Lookup of identifier is now done while resolving expressions
2020-05-25 14:37:09 +02:00
Simon Hausmann
e6bed90ced
Resolve the type in property declarations
...
... and added int32 as another primitive type.
2020-05-25 14:03:01 +02:00
Simon Hausmann
d4387b74b9
Rename Type::Number to Type::Float32
...
Properties of that type are implemented as f32.
2020-05-25 13:52:31 +02:00
Olivier Goffart
93158e63e8
Fix crash in the viewer when there is a Text{}
...
Wrong vtable was used.
2020-05-25 13:15:10 +02:00
Olivier Goffart
3629e5f158
Refactor the Expression
...
So we will resolve the expression in a different step
2020-05-25 13:15:10 +02:00
Simon Hausmann
32b99547f1
Parse property declarations
...
For now this uses the syntax
property<qualified type name> name;
2020-05-25 12:38:29 +02:00
Simon Hausmann
5accea4cdd
Add support for qualified type names to the parser
2020-05-25 11:53:44 +02:00
Olivier Goffart
3965d9048f
syntax_updater: also update the .rs files containing sixtyfps!
2020-05-25 11:49:52 +02:00
Olivier Goffart
dd756ef112
Adapt the parser to parse := instead of =
2020-05-25 10:46:00 +02:00
Olivier Goffart
5228f3695d
Revert "Replace '=' with ':='"
...
This reverts commit 7be8b09b3b
.
Now that the replacement is done
2020-05-25 10:45:10 +02:00
Olivier Goffart
d8601621c0
Use the tool to replace = with :=
2020-05-25 10:44:22 +02:00
Olivier Goffart
7be8b09b3b
Replace '=' with ':='
2020-05-25 10:43:19 +02:00
Olivier Goffart
058676e526
Initial import of a syntax_updater tool that rewrite files
2020-05-25 10:07:43 +02:00
Simon Hausmann
50ecffe1f1
Replace RenderingInfo with RenderingPrimitive
...
This is one data structure less and it avoids converting from the one to
the other.
2020-05-22 16:07:06 +02:00
Simon Hausmann
bcc6c6a60a
Move Color and RenderingPrimitive into abi::datastructures
...
This paves the way to replace RenderingInfo.
2020-05-22 16:07:06 +02:00
Simon Hausmann
230870a292
Style cleanup
...
Remove some where clauses that leads to less verbose signatures. Also
use impl FnFoo, which is shorter as well.
2020-05-22 16:07:06 +02:00
Simon Hausmann
d48faf711f
Update cached rendering data only when there are changes
...
This introduces a separate rendering preparation step in the main
window. As a consequence, the component becomes a parameter and the
graphicstest example can't use the main window anymore.
The decision whether a new low-level primitive needs to be created or
not is made by comparing the last RenderingPrimitive against the new
one.
On the upside, this means that property changes are now reflected in the
graphics.
2020-05-22 16:07:06 +02:00
Simon Hausmann
cd80a4038f
Clean up HasRenderingPrimitive trait API after transition
...
The extraction does not have to be optional anymore. That will make
future code using this simpler.
2020-05-22 16:07:06 +02:00
Simon Hausmann
21842bdd75
Remove the individual primitive factory functions from RenderingPrimitivesBuilder
...
Only use the new one that takes the new enum.
2020-05-22 16:07:06 +02:00
Simon Hausmann
9459578265
Add API to the RenderingPrimitivesBuilder to build the new style primitive
2020-05-22 16:07:06 +02:00
Simon Hausmann
5c8163d7a7
Introduce a new rendering primitive enum in the graphics module
...
This shall become the successor to RenderingInfo. For now it's just a
place holder, but the idea is that backend creates the opaque primitive
that holds this public rendering primitive, exposed via the
HasRenderingPrimitive trait.
2020-05-22 16:07:06 +02:00
Simon Hausmann
e7fd69bad1
Rename internal types
...
Rename the backend specific RenderingPrimitive to LowLevelRenderingPrimitive,
in order to make room for a high-level RenderingPrimitive enum that's public.
2020-05-22 16:07:06 +02:00
Simon Hausmann
f2662f0884
Simplify image primitives graphics API
...
Don't require a dest rect for now. Rendering is always at (0, 0) but
with the transformation applied. And the size shall for now not be a
parameter.
2020-05-22 16:07:06 +02:00
Simon Hausmann
bbc4c508f9
Minor cleanup
...
Replace lyon's rect import, which is a re-export of euclid's Rect<f32>,
with our own. Only the Path is
lyon specific, for now.
2020-05-22 16:07:06 +02:00
Olivier Goffart
270c626c6c
Make the Parser a trait
...
Because the rowan::GreenNode is read-only but i want to use the parser
to generate something that can be mutated
2020-05-22 15:31:27 +02:00
Olivier Goffart
0f977cbb25
Some documentation fixes for item generated with #[vtable]
2020-05-22 12:38:55 +02:00
Olivier Goffart
bf3a0878b5
Add documentation for the vtable crate
2020-05-22 11:17:45 +02:00
Simon Hausmann
33dd2d765d
Minor cleanup in item transform calculation
...
We can use the new geometry() getter to simplify the transform update by origin.
2020-05-22 09:33:08 +02:00