#diagnostics #macro #rome #registry #compile-time #codebase #build

rome_diagnostics_categories

Diagnostic categories for rome_diagnostics. It exposes a macro that emits compile-time errors for extranous categories.

1 unstable release

0.0.1 Apr 4, 2023

#10 in #rome

Download history 15/week @ 2024-06-17 33/week @ 2024-06-24 6/week @ 2024-07-01 10/week @ 2024-07-08 40/week @ 2024-07-15 15/week @ 2024-07-22 20/week @ 2024-07-29 22/week @ 2024-08-05 15/week @ 2024-08-12 14/week @ 2024-08-19 17/week @ 2024-08-26 13/week @ 2024-09-02 15/week @ 2024-09-09 19/week @ 2024-09-16 41/week @ 2024-09-23 27/week @ 2024-09-30

103 downloads per month
Used in 10 crates (2 directly)

MIT license

24KB
344 lines

rome_diagnostics_categories

This crate contains a static registry of all the diagnostic categories used throughout the Rome codebase

Code Generation

The list of categories is defined in src/categories.rs using the define_dategories! macro, but instead of relying on conventional Rust macro expansion this crate instead uses a build script (in build.rs) to control how the code resulting from the macro is generated.

Specifically this lets us generate new identifiers, which is something plain Rust macros cannot do, without having to use full-blown procedural macros, which would require creating and building yet another crate.

Dependencies

~18–365KB