Skip to content

Commit

Permalink
hot-fix: println -> print
Browse files Browse the repository at this point in the history
  • Loading branch information
ali77gh committed Oct 5, 2023
1 parent 27ec8e7 commit 976a4b5
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/parser/chunk_detector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ mod tests {
#[test]
fn chunk_detector_test(){
assert_eq!(
chunk_detector("println".to_string(),0),
Ok(Chunk::Function("println".to_string()))
chunk_detector("print".to_string(),0),
Ok(Chunk::Function("print".to_string()))
);
}

Expand Down
6 changes: 3 additions & 3 deletions src/parser/double_chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ mod tests{
#[test]
fn param_function_test(){
assert_eq!(
double_chunk_parser("$the_name".to_string(), "println".to_string(), 1),
Ok(ExecutableLine::new(1, "println".to_string(), vec![Param::Variable("the_name".to_string())], None))
double_chunk_parser("$the_name".to_string(), "print".to_string(), 1),
Ok(ExecutableLine::new(1, "print".to_string(), vec![Param::Variable("the_name".to_string())], None))
);
}

Expand All @@ -77,7 +77,7 @@ mod tests{
#[test]
fn function_function_test(){
assert_eq!(
double_chunk_parser("exit".to_string(), "println".to_string(), 1),
double_chunk_parser("exit".to_string(), "print".to_string(), 1),
Err(ChapError::syntax_with_msg(1, "assign a function to another function is not possible".to_string()))
);

Expand Down
6 changes: 3 additions & 3 deletions src/parser/single_chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub fn single_chunk_parser(ch1: String, line_number: u32) -> Result<ExecutableLi

match params.get(0).unwrap(){
Param::Tag(_) => ExecutableLine::new(line_number,"new_tag".to_string(), params, None),
_ => ExecutableLine::new(line_number, "println".to_string(), params, None),
_ => ExecutableLine::new(line_number, "print".to_string(), params, None),
}
},
Chunk::Function(name) =>
Expand All @@ -39,12 +39,12 @@ mod tests{
fn print_detector_parser(){
assert_eq!(
single_chunk_parser(" $myVar ".to_string(), 1),
Ok(ExecutableLine::new(1,"println".to_string(),vec![Param::Variable("myVar".to_string())],None))
Ok(ExecutableLine::new(1,"print".to_string(),vec![Param::Variable("myVar".to_string())],None))
);

assert_eq!(
single_chunk_parser(" \"hello\" ".to_string(), 1),
Ok(ExecutableLine::new(1,"println".to_string(),vec![Param::Value(DataType::String("hello".to_string()))],None))
Ok(ExecutableLine::new(1,"print".to_string(),vec![Param::Value(DataType::String("hello".to_string()))],None))
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/parser/triplet_chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ mod tests{
"params".to_string()
);
assert_eq!(
get_type_string(&Chunk::Function("println".to_string())),
get_type_string(&Chunk::Function("print".to_string())),
"function".to_string()
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ mod tests{

rt.on_new_line(ExecutableLine::new(
2,
"println".to_string(),
"print".to_string(),
vec![Param::Variable("name".to_string())],
None
)).unwrap();
Expand Down

0 comments on commit 976a4b5

Please sign in to comment.