Commit graph

26 commits

Author SHA1 Message Date
James Westman
a83c7e936d
black: Update formatting 2025-04-25 18:32:33 -05: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
ea92838cf3 Parse escape sequences instead of using replace
That way we can warn about invalid sequences. Also, the previous code had at least one subtle bug (`\\\\'`).
2023-09-28 17:18:45 -05:00
James Westman
3bcc9f4cbd Use the new Range class in more places 2023-07-25 20:01:41 -05:00
James Westman
62f74178f7 lsp: Implement "go to definition" 2023-07-25 18:40:05 -05:00
James Westman
e087aeb44f lsp: Add document outline 2023-07-25 17:59:52 -05:00
James Westman
883a136103 Fix parsing decimals
A number literal is a float if it contains ".", not if it is divisible
by 1. For example, 1.0 should be considered a float literal.
2023-07-20 19:25:25 -05:00
gregorni
3730e2e726 Add isort to CI and run on files 2023-07-09 14:26:37 +00:00
James Westman
5a782c653b Add Gtk.Scale mark syntax 2023-05-13 20:19:29 -05:00
James Westman
3f27e92eb0
Remove unnecessary list() call 2023-03-20 13:27:21 -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
0b7dbaf90d
Add some type hints 2023-01-12 15:49:19 -06:00
James Westman
be284de879
parse_tree: Fix Warning node 2023-01-12 15:49:18 -06:00
James Westman
8fee46ec68
Format using black 2022-12-19 11:52:59 -06:00
James Westman
86b07ef0ae
Fix new mypy errors 2022-11-26 16:22:34 -06:00
James Westman
4fefa0bd73
Add lookup expressions 2022-06-24 23:16:15 -05:00
James Westman
e76bff9291
Fix crash in parser
The Until parse node would return True if it reached EOF, which was not
correct and could cause other parse nodes to run past the end of the
token list and crash.
2022-04-18 17:34:02 -05:00
James Westman
9873a2072b Add warning for sync-create 2022-02-09 15:39:02 -06:00
James Westman
3bdcc83c4e tokenizer: Remove redundant token types 2022-02-09 15:24:56 -06:00
James Westman
ee5f32622f reorganization: Finish moving parsing and AST 2022-01-26 22:37:51 -06:00
James Westman
8f9de81e24 reorganization: Move hooks to common.py
This allows them to be referenced before they are filled, helping avoid
circular dependencies.
2022-01-26 14:50:36 -06:00
James Westman
76f7befd68
parser: Shorter code for groups
Add a "grammar" property on AstNode types so they can be used in grammar
expressions as groups
2022-01-24 14:43:00 -06:00
James Westman
8d587b62a0
parser: Simplify parser construction
- Replace several different parse nodes with Match, which matches the
  exact text of a token but not the token type
- Allow arrays to be used in place of Sequence
2022-01-24 14:42:44 -06:00
James Westman
8e1a9f72dd
parser: Merge consecutive "Unexpected tokens" errors
Fixes #24
2021-12-16 23:18:31 -06:00
James Westman
544d152fb6
Rename to blueprint-compiler
This isn't an official GTK project so better to avoid using "GTK" in the
name.
2021-12-01 15:35:58 -06:00
Renamed from gtkblueprinttool/parse_tree.py (Browse further)