@@ -214,7 +214,7 @@ pub use crate::language::quantity::Quantity;
214214// the validate functions all need to have start and end anchors, which seems
215215// like it should be abstracted away.
216216
217- pub fn validate_license ( input : & str ) -> Option < & str > {
217+ pub ( crate ) fn validate_license ( input : & str ) -> Option < & str > {
218218 let re = regex ! ( r"^[A-Za-z0-9.,\-_ \(\)\[\]]+$" ) ;
219219
220220 if re. is_match ( input) {
@@ -224,7 +224,7 @@ pub fn validate_license(input: &str) -> Option<&str> {
224224 }
225225}
226226
227- pub fn validate_copyright ( input : & str ) -> Option < & str > {
227+ pub ( crate ) fn validate_copyright ( input : & str ) -> Option < & str > {
228228 let re = regex ! ( r"^[A-Za-z0-9.,\-_ \(\)\[\]]+$" ) ;
229229
230230 if re. is_match ( input) {
@@ -234,7 +234,7 @@ pub fn validate_copyright(input: &str) -> Option<&str> {
234234 }
235235}
236236
237- pub fn validate_template ( input : & str ) -> Option < & str > {
237+ pub ( crate ) fn validate_template ( input : & str ) -> Option < & str > {
238238 let re = regex ! ( r"^[A-Za-z0-9.,\-]+$" ) ;
239239
240240 if re. is_match ( input) {
@@ -244,7 +244,7 @@ pub fn validate_template(input: &str) -> Option<&str> {
244244 }
245245}
246246
247- pub fn validate_identifier ( input : & str ) -> Option < Identifier < ' _ > > {
247+ pub ( crate ) fn validate_identifier ( input : & str ) -> Option < Identifier < ' _ > > {
248248 if input. len ( ) == 0 {
249249 return None ;
250250 }
@@ -257,7 +257,7 @@ pub fn validate_identifier(input: &str) -> Option<Identifier<'_>> {
257257 }
258258}
259259
260- pub fn validate_forma ( input : & str ) -> Option < Forma < ' _ > > {
260+ pub ( crate ) fn validate_forma ( input : & str ) -> Option < Forma < ' _ > > {
261261 if input. len ( ) == 0 {
262262 return None ;
263263 }
@@ -294,7 +294,7 @@ fn parse_tuple(input: &str) -> Option<Vec<Forma<'_>>> {
294294}
295295
296296/// This one copes with (and discards) any internal whitespace encountered.
297- pub fn validate_genus ( input : & str ) -> Option < Genus < ' _ > > {
297+ pub ( crate ) fn validate_genus ( input : & str ) -> Option < Genus < ' _ > > {
298298 let first = input
299299 . chars ( )
300300 . next ( )
@@ -371,33 +371,6 @@ pub fn validate_response(input: &str) -> Option<Response<'_>> {
371371 Some ( Response { value, condition } )
372372}
373373
374- fn _validate_decimal ( _input : & str ) -> Option < Numeric < ' _ > > {
375- // Test the regex macro availability within types.rs
376- let _decimal_regex = regex ! ( r"^\s*-?[0-9]+\.[0-9]+\s*$" ) ;
377- // For now, just return None since we removed Decimal variant
378- None
379- }
380-
381- pub fn validate_numeric ( input : & str ) -> Option < Numeric < ' _ > > {
382- if input. is_empty ( ) {
383- return None ;
384- }
385-
386- let input = input. trim_ascii ( ) ;
387-
388- // Try to parse as a simple Integral first
389- if let Ok ( amount) = input. parse :: < i64 > ( ) {
390- return Some ( Numeric :: Integral ( amount) ) ;
391- }
392-
393- // Try to parse as a Quantity (scientific notation with units)
394- if let Some ( quantity) = parse_quantity ( input) {
395- return Some ( Numeric :: Scientific ( quantity) ) ;
396- }
397-
398- None
399- }
400-
401374#[ cfg( test) ]
402375mod check {
403376 use super :: * ;
@@ -582,18 +555,6 @@ mod check {
582555 t1
583556 }
584557
585- #[ test]
586- fn numeric_rules ( ) {
587- // Test simple integers
588- assert_eq ! ( validate_numeric( "42" ) , Some ( Numeric :: Integral ( 42 ) ) ) ;
589- assert_eq ! ( validate_numeric( "0" ) , Some ( Numeric :: Integral ( 0 ) ) ) ;
590- assert_eq ! ( validate_numeric( "-123" ) , Some ( Numeric :: Integral ( -123 ) ) ) ;
591- assert_eq ! (
592- validate_numeric( "9223372036854775807" ) ,
593- Some ( Numeric :: Integral ( 9223372036854775807 ) )
594- ) ;
595- }
596-
597558 #[ test]
598559 fn ast_construction ( ) {
599560 let t1 = Metadata {
0 commit comments