Commit graph

24 commits

Author SHA1 Message Date
James Westman
a12d3f5c81
decompile: Fix bug in lookup tags
A lookup tag with no type attribute would crash the decompiler, even if
that was valid. This wasn't caught by the tests since blueprint never
generates such XML.

Also fixed a bug in the tests that caused decompiler-only tests not to
run.
2025-04-25 20:13:01 -05:00
James Westman
8c6f8760f7 language: Add expression literals
Add expression literals, so you can set properties of type
Gtk.Expression.
2025-01-04 17:09:57 +00:00
James Westman
9b9fab832b
Add tests, remove unused code, fix bugs
- Added tests for more error messages
- Test the "go to reference" feature at every character index of every
test case
- Delete unused code and imports
- Fix some bugs I found along the way
2024-12-22 18:00:39 -06:00
James Westman
6acf0fe5a0
tests: Test deprecations separately
Libraries can add new deprecations, or the environment you're running
the tests in might have old libraries where the things we test aren't
deprecated yet. Move the deprecations test into its own module with its
own code, so it can check library versions and skip the test if it won't
work.
2024-12-09 19:06:10 -06:00
James Westman
e19975e1f8
lsp: Add reference documentation on hover
For most constructs and keywords, show the relevant section of the
reference documentation on hover.
2024-10-20 21:10:14 -05:00
James Westman
a12ac1b976 decompiler: Support Adw.Breakpoint syntax
Also, improve handling of translated strings.
2024-08-24 12:29:14 -05:00
James Westman
c1a82a034b decompiler: Add more decompilable tags
Add more tags to the list of things the decompiler can handle. This
required some changes to track the containing object class in the
DecompileCtx, since some objects use the same tag names.

The improved support means we can test the decompiler on most of the
test suite. Any new test samples will by default be tested to ensure the
decompiler produces the original blueprint file.

Also, updated the decompiler to always use double quotes.
2024-07-26 23:05:37 -05:00
James Westman
8d734f7bbd lsp: Add hover docs for lookup expression props 2024-07-27 02:52:56 +00:00
James Westman
0a4b5d07a1 Remove PropertyBinding rule, just use Binding 2023-07-20 18:46:45 -05:00
gregorni
3730e2e726 Add isort to CI and run on files 2023-07-09 14:26:37 +00:00
James Westman
46e467bbfb Fix 'template' keyword in list item factories 2023-05-13 20:24:31 -05:00
James Westman
04509e4b2e Change template syntax
Templates now use a TypeName instead of an identifier, which makes it
clearer that it's an extern symbol (or that it's a Gtk.ListItem).
2023-05-13 16:49:48 -05:00
James Westman
9e82a2fb2a language: Rename expression classes
Rename the expression classes to match the documentation.
2023-05-06 15:30:18 -05:00
James Westman
ec844b10ca Add ScopeCtx instead of root.objects_by_id
This allows us to introduce new scopes, such as in
GtkBuilderListItemFactory templates.
2023-04-28 20:49:22 -05:00
James Westman
02796fd830 Use <> instead of () for casts & typeof
This makes it clearer that they aren't functions, and it eliminates
syntactic ambiguity with closure expressions.
2023-04-10 09:39:34 -05:00
James Westman
88f5b4f1c7
Fix template types 2023-04-08 20:10:16 -05:00
James Westman
90001bd885 Fix mypy errors & other bugs 2023-03-12 21:49:36 -05:00
James Westman
98ba7d467a Improve expression type checking 2023-03-12 16:12:16 -05:00
James Westman
8874cf60b3 parse_tree: Remove Pratt parser
It isn't actually needed; the way we parse expressions as a prefix
followed by zero or more suffixes is enough.
2023-03-11 21:05:27 -06:00
James Westman
1df46b5a06
Change the way values work
Change the parsing for values to make them more reusable, in particular
for when I implement extensions.
2023-01-12 15:49:19 -06:00
James Westman
59aa054c4c
language: Add closure expressions 2022-12-25 14:04:41 -06:00
James Westman
5cf9b63547
language: Add cast expressions 2022-12-25 14:04:40 -06:00
James Westman
a24f16109f
Separate output into its own module 2022-10-15 19:40:47 -05:00
James Westman
4fefa0bd73
Add lookup expressions 2022-06-24 23:16:15 -05:00