Commit graph

6069 commits

Author SHA1 Message Date
bglgwyng
3bfbc00bc0 docs: improve comment explaining empty node kind workaround in compatibility test 2025-11-20 23:16:34 +09:00
bglgwyng
c19cce111f refactor: use metadata_for_symbol helper in node_types generation 2025-11-20 19:25:29 +09:00
bglgwyng
cb8d926725 fix: remove broken test 2025-11-20 17:49:45 +09:00
bglgwyng
c5b70d3c5c fix: use is_named variable instead of hardcoded true in symbol_ids lookup 2025-11-20 17:43:45 +09:00
bglgwyng
921eee76b6 test: improve assertion message in node-types compatibility test 2025-11-20 14:42:04 +09:00
bglgwyng
096a844cda fix: handle empty node kind strings in node-types compatibility test 2025-11-20 14:40:07 +09:00
bglgwyng
6dcc1edff2 test: add parser and node-types.json compatibility tests for multiple grammars 2025-11-20 12:37:37 +09:00
bglgwyng
80b5bce27a fix: fix return value of get_node_types 2025-11-20 11:58:42 +09:00
bglgwyng
fc747bce53 refactor: change symbol_id to symbol_ids array in node-types schema 2025-11-19 22:54:16 +09:00
bglgwyng
f1f11bde00 Merge branch 'master' into include-symbol_id-in-node-types-json 2025-11-19 21:53:39 +09:00
bglgwyng
48b2440b1e refactor: remove unused imports from generate module 2025-11-19 21:51:22 +09:00
bglgwyng
98acc93411 fix: pass unique_aliases to assign symbol_ids for aliases 2025-11-19 21:48:08 +09:00
Will Lillis
877782a8a4 fix(docs): update cli docs to reflect changes to various subcommand
arguments
2025-11-19 04:30:01 -05:00
Antonin Delpeuch
0e1f715ef1 Move PathsJSON method, reformat 2025-11-19 03:57:13 -05:00
Antonin Delpeuch
f3012a999d feat(bindings): expose the queries dynamically
Available in the Rust, Python, and Node bindings

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2025-11-19 03:57:13 -05:00
bglgwyng
f4472c0140 refactor: change unique_aliases to store tuples with numeric symbol IDs 2025-11-19 13:19:47 +09:00
bglgwyng
9f3677dc10 refactor: remove unused alias ID generation code 2025-11-19 13:03:00 +09:00
bglgwyng
a496b8af43 refactor: change symbol_ids to store multiple IDs per node type 2025-11-18 22:57:07 +09:00
dependabot[bot]
3072d35ed5 build(deps): bump the cargo group with 2 updates
Bumps the cargo group with 2 updates: [cc](https://github.com/rust-lang/cc-rs) and [wasmparser](https://github.com/bytecodealliance/wasm-tools).


Updates `cc` from 1.2.45 to 1.2.46
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.45...cc-v1.2.46)

Updates `wasmparser` from 0.240.0 to 0.241.2
- [Release notes](https://github.com/bytecodealliance/wasm-tools/releases)
- [Commits](https://github.com/bytecodealliance/wasm-tools/commits)

---
updated-dependencies:
- dependency-name: cc
  dependency-version: 1.2.46
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: wasmparser
  dependency-version: 0.241.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-17 22:29:19 +01:00
Valeriy Kosikhin
57e3a7b2ca fix(loader): set correct runtime host for cc while cross-compiling
Pass the BUILD_TARGET variable from the build environment as 'host' for
the cc crate. Otherwise, when cross-compiled, cc will keep looking for a
cross-compiler instead of the native one on the target system.

Signed-off-by: Valeriy Kosikhin <vkosikhin@gmail.com>
2025-11-17 18:19:34 +01:00
Christian Clason
0df2916920 bulild(deps): cargo update 2025-11-14 11:28:00 +01:00
WillLillis
61c21aa408 refactor(generate)!: include path when available in IO errors 2025-11-14 11:28:00 +01:00
WillLillis
7eb23d9f3c refactor(config)!: transition from anyhow to thiserror 2025-11-14 11:28:00 +01:00
WillLillis
db2d221ae9 fix(generate): remove leftover imports of anyhow 2025-11-14 11:28:00 +01:00
WillLillis
67cb3cb881 refactor(loader)!: transition from anyhow to thiserror 2025-11-14 11:28:00 +01:00
bglgwyng
860a2ad6d7 chore: update nixpkgs to use cache and remove broken cargo-llvm-cov as a workaround 2025-11-14 16:56:22 +09:00
Marcono1234
12a31536e1 fix(docs): don't show mdbook help popup when using query editor 2025-11-12 23:43:03 -05:00
Will Lillis
7657cc9d35 fix(dsl): add ReservedRule to Rule type definition 2025-11-12 07:27:05 +01:00
dependabot[bot]
13ff3935ac build(deps): bump the cargo group with 3 updates
Bumps the cargo group with 3 updates: [cc](https://github.com/rust-lang/cc-rs), [libloading](https://github.com/nagisa/rust_libloading) and [schemars](https://github.com/GREsau/schemars).


Updates `cc` from 1.2.44 to 1.2.45
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.44...cc-v1.2.45)

Updates `libloading` from 0.8.9 to 0.9.0
- [Commits](https://github.com/nagisa/rust_libloading/compare/0.8.9...0.9.0)

Updates `schemars` from 1.0.4 to 1.0.5
- [Release notes](https://github.com/GREsau/schemars/releases)
- [Changelog](https://github.com/GREsau/schemars/blob/master/CHANGELOG.md)
- [Commits](https://github.com/GREsau/schemars/compare/v1.0.4...v1.0.5)

---
updated-dependencies:
- dependency-name: cc
  dependency-version: 1.2.45
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: libloading
  dependency-version: 0.9.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo
- dependency-name: schemars
  dependency-version: 1.0.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-10 23:04:54 +01:00
bglgwyng
0ad40ec263 refactor: extract symbol ID generation into dedicated module 2025-11-09 18:58:27 +09:00
bglgwyng
e029188319 test: update node type tests to use actual symbol IDs 2025-11-09 17:29:30 +09:00
bglgwyng
ff4c91a614 fix: fix grammar conflicts in test cases for parsing table generation 2025-11-09 17:14:00 +09:00
bglgwyng
ab9b098aad refactor: extract grammar introspection into separate module 2025-11-09 16:19:49 +09:00
bglgwyng
d2a2b4005a feat: add symbol_id field to node types schema 2025-11-07 17:33:56 +09:00
bglgwyng
04420e4b51 refactor: remove unused JSONOutput and GeneratedParser structs 2025-11-07 17:29:25 +09:00
bglgwyng
21c9f9ae4f refactor: change symbol_ids to store both string and numeric IDs
- Modified symbol_ids HashMap to store tuples of (String, u16) instead of just String
- Updated symbol ID generation to assign numeric IDs sequentially (0 for end symbol, then 1, 2, 3...)
- Changed all symbol_ids access patterns throughout codebase to use tuple destructuring (.0 for string, .1 for numeric)
- Updated node_types.json to use numeric u16 symbol_id instead of String
2025-11-07 17:29:05 +09:00
Will Lillis
361287fb56 fix(cli)!: deprecate --build flag for generate command 2025-11-07 08:51:24 +01:00
bglgwyng
8238c36f5f style: format 2025-11-07 16:47:08 +09:00
bglgwyng
4519e2b8cc feat: add symbol_id field to node type JSON output
- Added symbol_id as optional field in NodeTypeJSON struct for tracking grammar symbols
- Threaded symbol_ids HashMap through generate_node_types_json function to populate symbol IDs
- Updated all test assertions to include symbol_id: None for backward compatibility
2025-11-07 16:46:52 +09:00
bglgwyng
b7d85668fe refactor: extract grammar introspection into separate function
- Consolidated grammar processing logic into new `introspect_grammar` function
- Removed intermediate `GeneratedParser` and `JSONOutput` structs in favor of direct `GrammarIntrospection` struct
- Simplified code generation flow by separating grammar analysis from code rendering
2025-11-07 16:17:28 +09:00
bglgwyng
3b8a653167 refactor: extract symbol ID generation and helper functions
- Moved symbol ID generation logic out of renderer initialization into standalone function
- Extracted sanitize_identifier and metadata_for_symbol as reusable helper functions
- Symbol IDs now computed before rendering and passed to renderer constructor
2025-11-07 11:57:39 +09:00
dependabot[bot]
13d4db8bb4 build(deps): bump the cargo group across 1 directory with 6 updates
Bumps the cargo group with 6 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [cc](https://github.com/rust-lang/cc-rs) | `1.2.43` | `1.2.44` |
| [clap](https://github.com/clap-rs/clap) | `4.5.50` | `4.5.51` |
| [clap_complete](https://github.com/clap-rs/clap) | `4.5.59` | `4.5.60` |
| [clap_complete_nushell](https://github.com/clap-rs/clap) | `4.5.9` | `4.5.10` |
| [etcetera](https://github.com/lunacookies/etcetera) | `0.10.0` | `0.11.0` |
| [wasmparser](https://github.com/bytecodealliance/wasm-tools) | `0.229.0` | `0.240.0` |



Updates `cc` from 1.2.43 to 1.2.44
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.43...cc-v1.2.44)

Updates `clap` from 4.5.50 to 4.5.51
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.50...clap_complete-v4.5.51)

Updates `clap_complete` from 4.5.59 to 4.5.60
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.59...clap_complete-v4.5.60)

Updates `clap_complete_nushell` from 4.5.9 to 4.5.10
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete_nushell-v4.5.9...clap_complete_nushell-v4.5.10)

Updates `etcetera` from 0.10.0 to 0.11.0
- [Release notes](https://github.com/lunacookies/etcetera/releases)
- [Commits](https://github.com/lunacookies/etcetera/compare/v0.10.0...v0.11.0)

Updates `wasmparser` from 0.229.0 to 0.240.0
- [Release notes](https://github.com/bytecodealliance/wasm-tools/releases)
- [Commits](https://github.com/bytecodealliance/wasm-tools/commits)

---
updated-dependencies:
- dependency-name: cc
  dependency-version: 1.2.44
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: clap
  dependency-version: 4.5.51
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: clap_complete
  dependency-version: 4.5.60
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: clap_complete_nushell
  dependency-version: 4.5.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: etcetera
  dependency-version: 0.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo
- dependency-name: wasmparser
  dependency-version: 0.240.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-04 16:08:54 +01:00
Will Lillis
419a5a7305 fix(generate): don't short-circuit within extend_sorted 2025-11-03 01:22:29 -05:00
Will Lillis
c7b5f89392 feat(xtask): generate JSON schema for cli TestSummary 2025-11-02 21:08:55 -05:00
Will Lillis
d546e28abf fix(cli): mark report_states_for_rule and json/json_summary flags
for `generate` command as conflicting
2025-11-02 21:08:55 -05:00
WillLillis
86e2fd2337 fix(cli): correct behavior of parse --stat and --json-summary flags 2025-11-02 21:08:55 -05:00
WillLillis
ff255a2354 test: add coverage for new test aggregation method 2025-11-02 21:08:55 -05:00
WillLillis
fe67521b3d refactor(cli)!: deprecate json flags in favor of json-summary 2025-11-02 21:08:55 -05:00
WillLillis
f02d7e7e33 feat(test): display test results in JSON format 2025-11-02 21:08:55 -05:00
WillLillis
6a8676f335 refactor(test): generalize printing of test diff keys and diffs 2025-11-02 21:08:55 -05:00