Skip to content

Commit 4637575

Browse files
committed
math() not required when declaring vars
1 parent 344441c commit 4637575

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

examples/test.nys

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
use audio;
2-
audio();
1+
dec int age : 10 + 10 * 10;
2+
log(age)

src/run.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,13 +487,21 @@ pub fn run(
487487
let mut pass_vec: Vec<String> = Vec::new();
488488
pass_vec.push("a".to_string());
489489
pass_vec.push("(".to_string());
490+
491+
if memory_types[memory_types.len()-1] == "int"{
492+
pass_vec.push("math".to_string());
493+
pass_vec.push("(".to_string())
494+
}
490495
loop {
491496
if contents[position] == "\n" || contents[position] == ";" {
492497
break;
493498
}
494499
pass_vec.push(contents[position].clone().to_string());
495500
position += 1;
496501
}
502+
if memory_types[memory_types.len()-1] == "int"{
503+
pass_vec.push(")".to_string());
504+
}
497505
pass_vec.push(")".to_string());
498506
let value = functions::getstring(
499507
0,
@@ -1150,6 +1158,8 @@ pub fn run(
11501158
uses.clone(),
11511159
0,
11521160
)
1161+
1162+
11531163
.join("zzGVgfHaNtPMe7H9RRyx3rWC9JyyZdMkc2v")
11541164
.to_string();
11551165
let mut new_value = memory_values[postion]

0 commit comments

Comments
 (0)