File tree Expand file tree Collapse file tree 1 file changed +69
-1
lines changed
Expand file tree Collapse file tree 1 file changed +69
-1
lines changed Original file line number Diff line number Diff line change @@ -478,6 +478,45 @@ pub fn getstring(
478478 }
479479 }
480480 skips = leng;
481+ } else if vec[ y] == "numeric" {
482+ imput_s. push_str (
483+ is_number (
484+ y,
485+ vec. to_vec ( ) ,
486+ memory_names. clone ( ) ,
487+ memory_values. clone ( ) ,
488+ memory_types. clone ( ) ,
489+ func_names. clone ( ) ,
490+ func_par. clone ( ) ,
491+ func_code. clone ( ) ,
492+ dev,
493+ )
494+ . to_string ( )
495+ . as_str ( ) ,
496+ ) ;
497+ let mut leng = 0 ;
498+ let mut n2 = 0 ;
499+ let mut skip1 = false ;
500+ for f in y + 1 ..vec. len ( ) {
501+ if !skip1 {
502+ if vec[ y + 1 ] != "(" {
503+ println ! ( "You have to put a parentheses after a log" ) ;
504+ std:: process:: exit ( 1 ) ;
505+ }
506+ if vec[ f] == "(" {
507+ n2 += 1 ;
508+ } else if vec[ f] == ")" {
509+ n2 -= 1 ;
510+ }
511+ if n2 == 0 {
512+ skip1 = true ;
513+ for _z in y + 1 ..f + 1 {
514+ leng += 1 ;
515+ }
516+ }
517+ }
518+ }
519+ skips = leng;
481520 } else if vec[ y] == "input" {
482521 imput_s. push_str ( input ( ) . to_string ( ) . as_str ( ) ) ;
483522 let mut leng = 0 ;
@@ -911,7 +950,9 @@ pub fn getstring(
911950 || vec[ y] == "<"
912951 || vec[ y] == "!"
913952 || vec[ y] == "|"
914- || vec[ y] == "&" )
953+ || vec[ y] == "&"
954+ || vec[ y] == "true"
955+ || vec[ y] == "false" )
915956 {
916957 imput_s. push_str ( vec[ y] . as_str ( ) ) ;
917958 } else {
@@ -1332,6 +1373,33 @@ pub fn get_contents(
13321373 }
13331374}
13341375
1376+ pub fn is_number (
1377+ x : usize ,
1378+ contents : Vec < String > ,
1379+ memory_names : Vec < String > ,
1380+ memory_values : Vec < String > ,
1381+ memory_types : Vec < String > ,
1382+ func_names : Vec < String > ,
1383+ func_par : Vec < String > ,
1384+ func_code : Vec < String > ,
1385+ dev : bool ,
1386+ ) -> bool {
1387+ getstring (
1388+ x,
1389+ contents,
1390+ memory_names,
1391+ memory_values,
1392+ memory_types,
1393+ func_names,
1394+ func_par,
1395+ func_code,
1396+ dev,
1397+ 0 ,
1398+ )
1399+ . first ( )
1400+ . unwrap ( ) . parse :: < f64 > ( ) . is_ok ( )
1401+ }
1402+
13351403pub fn replace (
13361404 x : usize ,
13371405 contents : Vec < String > ,
You can’t perform that action at this time.
0 commit comments