Commit graph

29 commits

Author SHA1 Message Date
Olivier Goffart
dd3fa1c221 Make the BindingMap hold RefCell of the BindingExpression
This will allow later to be able to operate on the binding despite the
element is borrowed.

Since the Binding itself is in a RefCell, the analysis don't need to
be anymore.
To do this change, a small change in the binding_analysis logic was required
which means that we will now detect binding loop if a binding was causing
two binding loop. (before, only one binding loop was detected)
2021-11-11 11:14:59 +01:00
Olivier Goffart
f6cf8b6d47 Check the analysys of the base component
If there is a Expression::Invalid as a binding (because it has an animation,
for example) we must check that the binding expression in the base is not
constant.

This fixes the rust test `properties_animation_merging` without inlining
(The o4_val was considered constant despite it shouldn't be)
2021-11-08 20:03:26 +01:00
Olivier Goffart
025b34e8e3 Fix wrong analysis leading to wrong optimization
We need to mark property as set externally before propagating
the is_set on aliases

Fixes test_cpp_bindings_two_way_model without inlining
2021-11-03 13:13:53 +01:00
Olivier Goffart
114137ddfa Make sure to mark declared aliases as set
Fix the dialog test when not inlining, because it declared all these
xxx-clicked aliases and if we don't propagate their usage, they will be
optimized away
2021-11-03 09:55:04 +01:00
Olivier Goffart
e6d1f91948 The binding analysis also need to go in callback to detect usages 2021-11-02 10:35:42 +01:00
Olivier Goffart
5af4e827a2 Properly visit more binding and keep analysis
This fix a bunch of test broken by the previous commit
2021-10-28 15:52:29 +02:00
Olivier Goffart
f833c944de Make sure we do not optimize away properties used from other components 2021-10-28 15:52:29 +02:00
Olivier Goffart
c9c43766f4 fixup previous commit: remove stray debug 2021-10-28 15:52:29 +02:00
Olivier Goffart
9c6bc6afc7 Do the property analysis accounting for several component 2021-10-28 15:52:29 +02:00
Olivier Goffart
b2392c25c7 Basic support for Multi-line TextInput 2021-09-01 16:52:37 +02:00
Olivier Goffart
b42c187ed1 Refactor the way the two-ways biding are represented internaly
Don't put them in a fake expression.
This simplifies a bit the expression handling, and will make
possible to fix analysis that needs a vew into the aliases
2021-08-20 18:26:36 +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
Olivier Goffart
a987b225b5 Collect all used components before inlining
And do some passes before inlining

We will need the list of components before inlining in order to generate
them if we disable inlining

So we can do some passes on each component before they are inlining

I tried to put the flickable pass in that list, but it did not work
if the Flickable itself is the root of a component
2021-07-07 17:58:43 +02:00
Tobias Hunger
e5bdeaa804 Janitor: Remove unnecessary & 2021-07-07 08:42:28 +02:00
Tobias Hunger
4be9ca7ffd Janitor: Remove useless () return types 2021-07-05 09:48:29 +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
Tobias Hunger
4b077d48ae Janiotor: String fix that might have side effect
This changes the name of a NamedReference and I am not sure this change
has no side effects, so put this into an extra patch.

As usual: No behavior change is intended!
2021-06-28 08:32:00 +02:00
Tobias Hunger
a39ce28c7a Janitor: Fiy typo in function name
No behavior change is intended here!
2021-06-28 08:32:00 +02:00
Olivier Goffart
725543108f Fix tests regarding to constant propagation 2021-06-22 14:59:07 +02:00
Olivier Goffart
cb75d44acc Fix setting model properties to aliased properties 2021-06-22 13:31:27 +02:00
Olivier Goffart
fb7050e3e6 Properly detect layout loop involving images 2021-06-21 12:33:15 +02:00
Olivier Goffart
19cef07d96 Properly detect loop in layout
cc #257
2021-06-18 20:30:14 +02:00
Olivier Goffart
0b6bd7b219 Fix accessing elided property
Fixes #177
2021-06-18 15:08:30 +02:00
Olivier Goffart
deaa0fddb0 WIP layout: split vertical and horizontal cache
Split the vertical and horizontal pass into different property cache
This will allow to implement "height for with"

This patch does not port the Rust or C++ binding yet
2021-06-16 15:14:07 +02:00
Olivier Goffart
1aed36d122 Be sure to propagate the fact that properties are changed for aliases 2021-05-21 10:06:26 +02:00
Olivier Goffart
54be5f3a84 Some ground work to make more binding analysis
- Mark builtin properties that are modified by the native code as output
 - Record wether the property is set by code in the .60
 - Add a field that will tell us if a property binding is constant
2021-05-20 13:40:51 +02:00
Olivier Goffart
73c396ed7a Report binding loops for layouts 2021-05-18 12:25:19 +02:00
Olivier Goffart
3548c48bff Detect binding loop at compile-time
FIXME: i've currently disabled layout from the detection because it reports
error in our current examples
2021-05-15 15:49:27 +02:00