Commit graph

32 commits

Author SHA1 Message Date
Simon Hausmann
c85f2537d3 Fix signature of function to load types from a directory
Taking &mut self makes more sense when wanting to populate from a list.

Also we should return a list of diagnostics for each file that we loaded
or an error if we couldn't load the file (for example due to permission
problems, etc.).

This way the caller can choose to show diagnostics, ignore them, etc.
2020-07-16 13:45:45 +02:00
Simon Hausmann
c3aae7648a Further simplify compilation call sites
Remove the need to construct the type registry at all the call sites by
offering a compile_syntax_node function in the compiler library.
2020-07-16 09:25:26 +02:00
Simon Hausmann
2ac0805409 Minor cleanup
Don't need an accessor function in the Document for a public field. That said,
the choice of registry instance for the path "compilation" doesn't really matter,
as the lookup shall always end up
in the global registry.
2020-07-15 13:36:30 +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
Simon Hausmann
719bff4eca Minor cleanup
Don't require a mutable type registry for the compiler passes.
2020-07-15 11:25:28 +02:00
Simon Hausmann
f6761e2c4c Allow for the positioning of PathLayouts via x/y properties
These are just "virtual" properties that will be transformed into
property members of the main struct through the optimized elements
sub-pass.
2020-07-13 13:34:04 +02:00
Simon Hausmann
a679f33871 Process path elements in PathLayout
Collect them and assign them to an "elements" property, like with Path {}.

Also process paths before layouts.
2020-07-09 14:18:27 +02:00
Simon Hausmann
251ef7fc97 Add support for SVG commands in Path elements
Using the commands property we can just paste SVG paths. This makes it
much easier to write examples/demos. A good online path designer is
for example https://codepen.io/anthonydugois/pen/mewdyZ
2020-07-09 13:41:57 +02:00
Simon Hausmann
a83127ace8 Prepare the path element compilation for extensibility
Avoid any element specific code in the Rust and C++ generator and
minimize the involvement in the interpreter.
2020-07-07 14:14:17 +02:00
Simon Hausmann
a71c67152e Revert "Prepare for additional path elements"
This reverts commit d143addb07.

We're going to need to support binding expressions in path elements.
2020-07-07 14:14:17 +02:00
Simon Hausmann
facc18d0eb Fix formatting
RA stopped working for some odd reason :-/
2020-07-02 11:25:29 +02:00
Simon Hausmann
d143addb07 Prepare for additional path elements
Require that the values to the path element properties are numerical literals.
The conversion happens in the path "compilation" pass, where we can do more
pre-calcuation in the future.
2020-07-02 10:40:31 +02:00
Simon Hausmann
5e61ed4ad2 Implement Path and LineTo in the markup 2020-07-01 15:13:23 +02:00
Olivier Goffart
6122f91fba Begin with the generation of rhe repeater (rust only for now) 2020-06-16 13:47:02 +02:00
Olivier Goffart
e9b75d30b7 Add a bunch of deny(unsafe_code) 2020-06-12 21:04:27 +02:00
Olivier Goffart
96a372e45d Grid layout in the interpreter
current imploementation is just a prototype
2020-06-10 19:40:47 +02:00
Simon Hausmann
1404cb73ae Add support for embedding resources in the rust generator
This is relatively straight-forward via a pass in the compiler to
collect the resources to embed and then use include_bytes! (once per
resource).

What's really annoying is that the rust resource enum can't store a
&'static [u8] because cbindgen doesn't represent that, probably because
the slice representation isn't guaranteed to stay as it is. So instead
this, for now, uses raw pointers.
2020-06-09 22:54:29 +02:00
Olivier Goffart
c05da294a1 Add GridLayout and Row
The compiler currently lowers them to nothing
2020-06-09 12:46:16 +02:00
Olivier Goffart
9fc60e104f Add another way to load .60 files from a build script 2020-06-05 13:45:38 +02:00
Simon Hausmann
c8b64f5c4b Remove the lowering
The LoweredItem and LoweredComponent contained, in essence, the same
information as the Element and Component in object_tree. Since the
moving declarations pass moved everything to the root element and the
LoweredPropertyDeclarations have been removed as well, this is the last
step.
2020-05-27 14:45:35 +02:00
Olivier Goffart
c137b4dab5 Add a pass to move all declaration on the top level 2020-05-27 09:37:46 +02:00
Olivier Goffart
3472674262 Add a pass to assign unique id to the elements 2020-05-27 08:20:52 +02:00
Olivier Goffart
4ea78134d8 Recactor the compiler so there are passes 2020-05-26 09:40:36 +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
Olivier Goffart
3629e5f158 Refactor the Expression
So we will resolve the expression in a different step
2020-05-25 13:15:10 +02:00
Olivier Goffart
b9cd725f78 Allow to use proc_macro tokens
And report errors
2020-05-11 22:24:28 +02:00
Olivier Goffart
a9690a2fa3 Add a bunch of comments 2020-05-07 14:39:54 +02:00
Olivier Goffart
05624c68ee Add some properties in the Rectangle 2020-05-06 17:53:42 +02:00
Olivier Goffart
acccb33c8c Lower and generate some C++ 2020-05-05 18:31:00 +02:00
Olivier Goffart
3a6d39bfe9 Generate an object tree 2020-05-05 11:18:13 +02:00
Olivier Goffart
fbf0eebfd5 Draft of the parser 2020-05-04 14:30:05 +02:00
Simon Hausmann
c6553d007e Initial commit laying out the structure 2020-05-04 10:49:58 +02:00