From b3d4a9f6c3304c7491d7cd4d90086d67db881c4e Mon Sep 17 00:00:00 2001 From: frosch Date: Tue, 30 Apr 2024 21:24:49 +0200 Subject: [PATCH] feat: allow font-size commands at any position. This validation is not worth the hassle. Colors have similar requirements and would be even more complicated to validate. --- src/commands.rs | 111 ------------------------------------------------ src/validate.rs | 21 +-------- 2 files changed, 1 insertion(+), 131 deletions(-) diff --git a/src/commands.rs b/src/commands.rs index 8c8f9d6..1d265d7 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -43,7 +43,6 @@ pub struct CommandInfo<'a> { pub norm_name: Option<&'a str>, pub dialects: &'a [Dialect], pub occurence: Occurence, - pub front_only: bool, pub allow_case: bool, pub def_plural_subindex: Option, pub parameters: &'a [ParameterInfo], @@ -84,7 +83,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::ANY, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -94,7 +92,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::ANY, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -105,7 +102,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::ANY, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -115,7 +111,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::ANY, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -125,7 +120,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::ANY, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -135,7 +129,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::ANY, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -145,7 +138,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::ANY, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -155,7 +147,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::ANY, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -165,7 +156,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::ANY, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -176,7 +166,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::ANY, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -186,7 +175,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -196,7 +184,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -206,7 +193,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -216,7 +202,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -226,7 +211,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -236,7 +220,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -249,7 +232,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D__O, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -259,7 +241,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D__O, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -269,7 +250,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D__O, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -279,7 +259,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D__O, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -289,7 +268,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D__O, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -299,7 +277,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D__O, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -309,7 +286,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D__O, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -320,7 +296,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D__O, occurence: Occurence::ANY, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -330,7 +305,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D__O, occurence: Occurence::ANY, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -340,7 +314,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D__O, occurence: Occurence::ANY, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -350,7 +323,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D__O, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[P__], @@ -361,7 +333,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::EXACT, - front_only: true, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -371,7 +342,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::EXACT, - front_only: true, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -381,7 +351,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::EXACT, - front_only: true, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -391,7 +360,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::EXACT, - front_only: true, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -402,7 +370,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -412,7 +379,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -422,7 +388,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -432,7 +397,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -442,7 +406,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -452,7 +415,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -462,7 +424,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -472,7 +433,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -482,7 +442,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -492,7 +451,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -502,7 +460,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -512,7 +469,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -522,7 +478,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -532,7 +487,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -542,7 +496,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -552,7 +505,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -562,7 +514,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -573,7 +524,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::ANY, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -583,7 +533,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::ANY, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[], @@ -593,7 +542,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[P__], @@ -603,7 +551,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DN__, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[P__], @@ -614,7 +561,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::NONZERO, - front_only: false, allow_case: true, def_plural_subindex: None, parameters: &[P_G], @@ -624,7 +570,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: Some("STRING"), dialects: D_GO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[P_G], @@ -634,7 +579,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: Some("STRING"), dialects: D_GO, occurence: Occurence::NONZERO, - front_only: false, allow_case: true, def_plural_subindex: None, parameters: &[P_G, PPG], @@ -644,7 +588,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: Some("STRING"), dialects: D_GO, occurence: Occurence::NONZERO, - front_only: false, allow_case: true, def_plural_subindex: None, parameters: &[P_G, PPG, PPG], @@ -654,7 +597,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: Some("STRING"), dialects: D_GO, occurence: Occurence::NONZERO, - front_only: false, allow_case: true, def_plural_subindex: None, parameters: &[P_G, PPG, PPG, PPG], @@ -664,7 +606,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: Some("STRING"), dialects: D_GO, occurence: Occurence::NONZERO, - front_only: false, allow_case: true, def_plural_subindex: None, parameters: &[P_G, PPG, PPG, PPG, PPG], @@ -674,7 +615,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: Some("STRING"), dialects: D_GO, occurence: Occurence::NONZERO, - front_only: false, allow_case: true, def_plural_subindex: None, parameters: &[P_G, PPG, PPG, PPG, PPG, PPG], @@ -684,7 +624,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: Some("STRING"), dialects: D_GO, occurence: Occurence::NONZERO, - front_only: false, allow_case: true, def_plural_subindex: None, parameters: &[P_G, PPG, PPG, PPG, PPG, PPG, PPG], @@ -694,7 +633,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: Some("STRING"), dialects: D_GO, occurence: Occurence::NONZERO, - front_only: false, allow_case: true, def_plural_subindex: None, parameters: &[P_G, PPG, PPG, PPG, PPG, PPG, PPG, PPG], @@ -705,7 +643,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: Some(0), parameters: &[PP_], @@ -715,7 +652,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DN__, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: Some(0), parameters: &[PP_], @@ -725,7 +661,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DN__, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: Some(0), parameters: &[PP_], @@ -735,7 +670,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: Some(0), parameters: &[PP_], @@ -745,7 +679,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: Some(0), parameters: &[PP_], @@ -756,7 +689,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: Some(0), parameters: &[PP_, P__], @@ -766,7 +698,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: Some(0), parameters: &[PP_, P__], @@ -777,7 +708,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: Some(0), parameters: &[PP_], @@ -787,7 +717,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: Some(0), parameters: &[PP_], @@ -797,7 +726,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DN__, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: Some(0), parameters: &[PP_], @@ -807,7 +735,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: Some(0), parameters: &[PP_], @@ -817,7 +744,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: Some(0), parameters: &[PP_], @@ -827,7 +753,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: Some(0), parameters: &[PP_], @@ -837,7 +762,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DN__, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: Some(0), parameters: &[PP_], @@ -847,7 +771,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: Some(0), parameters: &[PP_], @@ -857,7 +780,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: Some(0), parameters: &[PP_], @@ -867,7 +789,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: Some(0), parameters: &[PP_], @@ -877,7 +798,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: Some(0), parameters: &[PP_], @@ -887,7 +807,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: Some(0), parameters: &[PP_], @@ -897,7 +816,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DN__, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: Some(0), parameters: &[PP_], @@ -907,7 +825,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: Some(0), parameters: &[PP_], @@ -917,7 +834,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: Some(0), parameters: &[PP_], @@ -927,7 +843,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: Some(0), parameters: &[PPG], @@ -937,7 +852,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: Some(0), parameters: &[PPG], @@ -947,7 +861,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: Some(0), parameters: &[PPG], @@ -957,7 +870,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: Some(0), parameters: &[PPG], @@ -968,7 +880,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: Some(1), parameters: &[P_G, PP_], @@ -978,7 +889,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: Some(1), parameters: &[P_G, PP_], @@ -988,7 +898,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: Some(1), parameters: &[P__, PP_], @@ -999,7 +908,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DN__, occurence: Occurence::EXACT, - front_only: false, allow_case: true, def_plural_subindex: None, parameters: &[P__], @@ -1009,7 +917,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DN__, occurence: Occurence::EXACT, - front_only: false, allow_case: true, def_plural_subindex: None, parameters: &[P__], @@ -1019,7 +926,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::EXACT, - front_only: false, allow_case: true, def_plural_subindex: None, parameters: &[P__], @@ -1029,7 +935,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::EXACT, - front_only: false, allow_case: true, def_plural_subindex: None, parameters: &[P__], @@ -1039,7 +944,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[P__], @@ -1049,7 +953,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::EXACT, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[P__], @@ -1060,7 +963,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DN__, occurence: Occurence::NONZERO, - front_only: false, allow_case: true, def_plural_subindex: None, parameters: &[P_G], @@ -1070,7 +972,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::EXACT, - front_only: false, allow_case: true, def_plural_subindex: None, parameters: &[P__], @@ -1080,7 +981,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::NONZERO, - front_only: false, allow_case: true, def_plural_subindex: None, parameters: &[P_G], @@ -1090,7 +990,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[P_G], @@ -1100,7 +999,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: DNGO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[P_G], @@ -1110,7 +1008,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[P_G, P__], @@ -1120,7 +1017,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[P_G], @@ -1130,7 +1026,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[P_G], @@ -1140,7 +1035,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[P_G], @@ -1150,7 +1044,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[P_G], @@ -1160,7 +1053,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[P_G], @@ -1170,7 +1062,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[P_G], @@ -1180,7 +1071,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[P__], @@ -1190,7 +1080,6 @@ pub const COMMANDS: &'static [CommandInfo] = &[ norm_name: None, dialects: D_GO, occurence: Occurence::NONZERO, - front_only: false, allow_case: false, def_plural_subindex: None, parameters: &[P_G], diff --git a/src/validate.rs b/src/validate.rs index 3dc7e9f..d0fe85d 100644 --- a/src/validate.rs +++ b/src/validate.rs @@ -337,15 +337,6 @@ fn validate_string( .into_iter() .find(|ci| ci.name == cmd.name && ci.dialects.contains(&dialect))); if let Some(info) = opt_info { - if info.front_only && front == 2 { - errors.push(ValidationError { - severity: Severity::Warning, - pos_begin: Some(fragment.pos_begin), - pos_end: Some(fragment.pos_end), - message: format!("Command '{{{}}}' must be at the front.", cmd.name), - suggestion: None, - }); - } if let Some(c) = &cmd.case { if !config.allow_cases() { errors.push(ValidationError { @@ -1094,17 +1085,7 @@ mod tests { { let trans = ParsedString::parse("foo{BIG_FONT}bar{NUM}").unwrap(); let val_trans = validate_string(&config, &trans, Some(&base)); - assert_eq!(val_trans.len(), 1); - assert_eq!( - val_trans[0], - ValidationError { - severity: Severity::Warning, - pos_begin: Some(3), - pos_end: Some(13), - message: String::from("Command '{BIG_FONT}' must be at the front."), - suggestion: None, - } - ); + assert_eq!(val_trans.len(), 0); } { let trans = ParsedString::parse("foo{G=a}bar{NUM}").unwrap();