Skip to content

Commit 8e93a14

Browse files
author
Arthur Melton
committed
count test works
1 parent 5e4290a commit 8e93a14

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

examples/test.nys

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
func(count(number)) {
22
dec int new_number: number+1;
33
log(new_number);
4-
count(count(new_number));
4+
count(new_number);
55
}
66
count(0);

src/lexer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub fn no_extra_whitespace(mut input: Vec<String>, dev: bool) -> Vec<String> {
2020
if (input[i] == "\"" || input[i] == "\'" || input[i] == r"\`") && input[i - 1] != "\\" {
2121
quotes += 1;
2222
}
23-
if quotes % 2 == 0 && input[i] == " " {
23+
if quotes % 2 == 0 && input[i].trim() == "" {
2424
delete.push(i);
2525
}
2626
}

src/run.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,9 @@ pub fn run(
506506
position += 1;
507507
}
508508
pass_vec.push(")".to_string());
509+
if contents[x + 1] == "int" {
510+
pass_vec.push(")".to_string());
511+
}
509512
let value = functions::getstring(
510513
0,
511514
pass_vec.clone(),
@@ -1031,11 +1034,7 @@ pub fn run(
10311034
contetntstr.push(t.to_string());
10321035
}
10331036
let mut contetntstr1: Vec<String> = Vec::new();
1034-
for t in
1035-
func_par[postion].split("zzGVgfHaNtPMe7H9RRyx3rWC9JyyZdMkc2v")
1036-
{
1037-
contetntstr1.push(t.to_string());
1038-
}
1037+
let mut contetntstr3: Vec<String> = Vec::new();
10391038
let contetntstr2: Vec<String> = functions::getstring(
10401039
x,
10411040
contents.clone(),
@@ -1053,14 +1052,20 @@ pub fn run(
10531052
func_par[postion].split("zzGVgfHaNtPMe7H9RRyx3rWC9JyyZdMkc2v")
10541053
{
10551054
contetntstr1.push(t.to_string());
1055+
contetntstr3.push("str".to_string());
1056+
}
1057+
if dev {
1058+
println!("contetntstr1: {:?}", contetntstr1);
1059+
println!("contetntstr2: {:?}", contetntstr2);
1060+
println!("contetntstr3: {:?}", contetntstr3);
10561061
}
10571062
let _output = run(
10581063
contetntstr,
10591064
dev,
10601065
uses.clone(),
10611066
contetntstr1.clone(),
10621067
contetntstr2.clone(),
1063-
memory_types.clone(),
1068+
contetntstr3.clone(),
10641069
func_names.clone(),
10651070
func_par.clone(),
10661071
func_code.clone(),

0 commit comments

Comments
 (0)