Simon Hausmann
732a56259f
Simplify compilation call sites further
...
Move run_passes into the library compilation function. That way the
FileDiagnostics are created by the parser, can be passed on to the library
compilation function and after that we don't need them anymore and can
replace them with future BuildDiagnostics for example.
2020-07-16 18:53:59 +02:00
Simon Hausmann
4c65760322
Fold FileLoadError into the diagnostics module
...
The FileDiagnostics now hold a vector of Diagnostic elements, which is an
enum of either a CompilerDiagnostic or a FileLoadError.
2020-07-16 18:28:27 +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
64a4e749b7
Simplify path setup in the Diagnostics
...
Pass the path to the parse function, as that's easier at most call sites.
Also offer a convenience parse_file function.
2020-07-15 19:21:25 +02:00
Simon Hausmann
8e047d3761
Simplify compiler diagnostics API
...
Don't require the callers to hold on to the source code string until an
eventual diagnostics code path is hit. Instead it turns out it's
simpler to let the parser consume the source code as string, where
internally after tokenizing it can be moved into the diagnostics and
from there into the code map if needed.
There are a few places where we now clone the source code, but that's
only in cases where we also extract stuff separately (test code) or the
syntax updater.
2020-07-15 17:34:11 +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
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
911d34e777
Use BTreeMap for the object type so that type order is deterministic
2020-06-18 17:48:08 +02:00
Olivier Goffart
195a5d0e84
Syntax tests: do not try to generate a document tree if the parser did not succeed
2020-06-15 09:37:56 +02:00
Olivier Goffart
f71b778e76
Syntax tests: Log which file is causing a panic
2020-06-15 09:34:41 +02:00
Olivier Goffart
e95d7da888
Parser: typed syntax node accessor
2020-06-11 17:50:28 +02:00
Simon Hausmann
f95b31bca4
Fix build
2020-06-09 23:24:38 +02:00
Olivier Goffart
3651885d87
Move the compiler binary in tools/
...
And rename sixtyfps_compiler to sixtyfps_compilerlib
2020-06-05 09:23:38 +02:00
Olivier Goffart
b3d1a7196c
Compile fix
2020-05-26 12:15:31 +02:00
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
4ea78134d8
Recactor the compiler so there are passes
2020-05-26 09:40:36 +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
Olivier Goffart
ce657a5b01
Add test for failled lookup
2020-05-25 15:50:34 +02:00
Olivier Goffart
efe0ccfb3f
Add support for signal in the parser
...
(currently not doing anything else than parsing)
2020-05-20 12:53:08 +02:00
Olivier Goffart
260f17a3e0
Support for inline components within a .60 file
2020-05-19 17:43:56 +02:00
Olivier Goffart
b9cd725f78
Allow to use proc_macro tokens
...
And report errors
2020-05-11 22:24:28 +02:00
Olivier Goffart
05624c68ee
Add some properties in the Rectangle
2020-05-06 17:53:42 +02:00
Olivier Goffart
3a541ec1eb
Handle children elements
2020-05-06 16:43:04 +02:00
Olivier Goffart
cd670d6012
Compiler tests
2020-05-05 12:43:42 +02:00