292 Commits

Author SHA1 Message Date
fe5e7a7dcf
Replaced some BTreeMaps with HashMaps. 2025-02-04 15:38:56 +00:00
2ee5f5796a
Replaced several more IndexMaps with HashMaps. 2025-02-04 15:37:48 +00:00
e5a5580832
Replaced unnecessary IndexMap with an HashMap. 2025-02-04 15:36:18 +00:00
1d4e48d07c
Removed Arc wrapping of some things.
They do help with performance when cloning, but we'll be removing cloning as much as possible in the future, so this will just get in the way by adding another indirection.
2025-02-04 15:31:27 +00:00
4608fba735
Resolved patterns are now a small vector of size 1.
This avoids many allocations from the btreemap.
2025-02-04 15:27:04 +00:00
31847e80ce
Fixed expression printing not having {}. 2025-02-04 14:14:34 +00:00
f4ed20d3d4
Added empty example for measuring startup performance. 2025-02-03 10:29:20 +00:00
aa3246831d
Updated all examples with new syntax. 2025-02-03 10:10:25 +00:00
a06d6185eb
ArcStr now uses yoke to avoid unsafe. 2025-02-03 09:54:59 +00:00
4d6991314a
Added missing safety comment. 2025-02-03 09:15:32 +00:00
f92532e9c3
Removed another use of unsafe in ArcStr. 2025-02-03 09:13:56 +00:00
e87e327c19
ArcStr now holds a &'static str instead of a NonNull<str>.
Safety-wise it's about the same, but now we ensure that the construction is the unsafe part, which is easier to verify.
2025-02-03 09:13:12 +00:00
bb8b391c7d
Added an ArcStr test to ensure safety across a panic. 2025-02-03 09:01:13 +00:00
6d9ca63b31
Removed a usage of unsafe using str::substr_range. 2025-02-03 08:50:01 +00:00
5c09a6f9bb
Removed easy conversion between &str and ArcStr.
This is not cheap, and if possible, we should try to go from `ArcStr` to `ArcStr` instead.
2025-02-03 08:38:39 +00:00
e511a13e26
Removed most ArcStr allocations in build::parse_deps_file.
Now only a single allocation exists for the file contents.
2025-02-03 08:38:16 +00:00
8782b87252
ExprTree::find now receives an ArcStr to avoid creating a new one with no associated string. 2025-02-03 08:34:57 +00:00
e36f260ec6
Removed useless field of Expander. 2025-02-03 08:31:11 +00:00
2d144123a2
Removed some old lints. 2025-02-03 08:30:49 +00:00
1479fe88b9
Added minimal vscode extension for zbuild files. 2025-02-03 08:19:43 +00:00
3aeee578d1
Added include statements.
Currently just works as-if copy-pasting the contents, with no scoping.
2025-02-03 06:52:43 +00:00
7c4f4cd8ea
ast::parse now receives a path instead of a string.
This allows the error message to also print the file, which allows clicking on the terminal output to go to the error location in some terminals.
2025-02-03 06:35:34 +00:00
8898847018
Moved Ast::parse_full into a free function. 2025-02-03 06:23:46 +00:00
6694941c0d
Removed lifetimes from Ast. 2025-02-02 23:11:30 +00:00
86905a0ad6
Full execution syntax now uses the same syntax as rules. 2025-02-01 21:05:21 +00:00
e21da1eb1e
Rule outputs, dependencies and execution are no longer arrays and must be declared separately.
Renamed rule dependencies from `deps` to `dep`.
2025-02-01 20:44:44 +00:00
c29c007394
Improved error handling. 2025-02-01 20:16:37 +00:00
556947adc1
Parser now doesn't completely discard information about previously parsed parts. 2025-02-01 19:39:16 +00:00
d44a389a87
Removed backtracing further than a token when parsing the AST.
`AnyOfN` now skips reporting the error position

Every time we have a split, we only ever peek at the next token, and then parse the corresponding type.
This will lead to better error messages.
2025-01-30 05:43:24 +00:00
abf35c9eeb
Replaced manual implementation of at_most with a call to it. 2025-01-30 05:17:49 +00:00
4f898806d2
Added some tests for ArcStr. 2025-01-30 05:08:09 +00:00
c7954bfeae
Removed warning on restriction lints. 2025-01-30 04:54:47 +00:00
5217f091b6
Replaced anyhow and AppError with zutil_app_error. 2025-01-30 04:48:04 +00:00
eedd24d9b5
Added more examples of failures. 2025-01-30 04:45:04 +00:00
cfeb34296d
Replaced tempdir with tempfile. 2025-01-30 02:14:23 +00:00
70b7698769
Upgraded all dependencies to latest. 2025-01-30 02:13:13 +00:00
0dc913ff61
Removed serde dependency. 2025-01-30 02:06:38 +00:00
0a37343f78
Multiple out, deps and exec statements are now allowed. 2025-01-30 02:02:36 +00:00
375015c64f
Replaced YAML ast with custom parser.
This should be several commits due to changing how aliases and patterns are implemented, but back-porting these changes to the yaml ast to just throw it away is wasteful, so it's done all at once.
We will also be simplified a large part of the codebase in the near time, so many of these changes are patchwork to make things work.
Due to this, the guide also needs to be rewritten from scratch, and so was currently removed and will be added again eventually.
2025-01-30 01:58:29 +00:00
9085213e94
Removed special casing of fully-matching patterns from ExprTree::find_match_suffix.
This special casing was absolutely wrong in some scenarios and caused rules to be used that cannot build certain files.
2025-01-30 01:50:14 +00:00
910dbedb59
Removed pattern operations. 2025-01-28 07:34:28 +00:00
37b74daae6
Fixed bug where specifying --path <file> failed whenever path was a file name with no separators. 2025-01-28 07:33:54 +00:00
475c994a0f
Updated to rustc 1.86.0-nightly (99768c80a 2025-01-23). 2025-01-27 03:32:54 +00:00
77a0ea0919
Unknown names are now printed with a debug representation. 2025-01-27 03:23:53 +00:00
b86969c722
Further removed a multiple collect when flattening dependencies. 2024-09-09 09:38:49 +01:00
c4ca1f6f27
Removed multiple collects into a single collect when collecting into ResultMultiple. 2024-09-09 09:23:22 +01:00
91529f62bc
Separated dependency building of build_unchecked into it's own function. 2024-09-09 09:13:49 +01:00
55a76bc6f9
Moved wrapper function Builder::build to where it's required.
This reduces the noise at the method level until we figure out why the compiler can't infer the `Send` bound on the future.
2024-09-09 09:08:57 +01:00
722ff93e16
Promoted debug log to info. 2024-09-05 01:17:28 +01:00
04928904ca
Added flag --always-build to always build all rules. 2024-09-05 01:17:26 +01:00