From 8aa39bd2fe4a90e65403566ad776e734386f88f5 Mon Sep 17 00:00:00 2001 From: Jonatan Waern Date: Tue, 27 May 2025 11:08:43 +0200 Subject: [PATCH] Add provisional param decl "explicit_param_decls" --- CHANGELOG.md | 3 ++- src/analysis/provisionals.rs | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d699978..a18e39e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,8 @@ ## 0.9.10 - Added indentation-style rules to the lint module with configurable indent size as specified in [example_lint_cfg.json](./example_files/example_lint_cfg.README) - +- Added "explicit\_param\_decl" as a know provisional (NOTE: the provisionals + actual functionality is not implemented) ## 0.9.9 - Fixed an issue that could cause analysis thread crash when an object was declared both as an array and not one diff --git a/src/analysis/provisionals.rs b/src/analysis/provisionals.rs index 21c71e7..cd49d9f 100644 --- a/src/analysis/provisionals.rs +++ b/src/analysis/provisionals.rs @@ -11,7 +11,10 @@ use crate::analysis::parsing::tree::LeafToken; use crate::analysis::FileSpec; #[derive(Debug, Clone, Copy, Eq, PartialEq, Hash, EnumString)] +#[strum(serialize_all = "snake_case")] pub enum Provisional { + // TODO: implement the neccessary checks for explicit params + ExplicitParamDecl, } impl fmt::Display for Provisional { @@ -57,3 +60,17 @@ impl ProvisionalsManager { } } } + +#[cfg(test)] +mod test { + use super::*; + + #[test] + fn test_provisionals_parsing() { + for (s, p) in [ + ("explicit_param_decl", Provisional::ExplicitParamDecl), + ] { + assert_eq!(Provisional::from_str(s), Ok(p)); + } + } +}