|
|
|
@ -21,7 +21,7 @@ use crate::parser::parse;
|
|
|
|
|
fn test_parse_empty_function() { |
|
|
|
|
let raw = "fn main() {}"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -33,7 +33,7 @@ fn test_parse_function_with_return() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -45,7 +45,7 @@ fn test_parse_redundant_semicolon() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_err()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -55,7 +55,7 @@ fn test_parse_no_function_context() {
|
|
|
|
|
let x = 1 |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_err()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -73,7 +73,7 @@ fn test_parse_multiple_functions() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -86,7 +86,7 @@ fn test_parse_variable_declaration() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -100,7 +100,7 @@ fn test_parse_variable_reassignment() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -114,7 +114,7 @@ fn test_parse_variable_declaration_added() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -126,7 +126,7 @@ fn test_parse_function_with_args() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -142,7 +142,7 @@ fn test_parse_function_call() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -158,7 +158,7 @@ fn test_parse_return_function_call() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -174,7 +174,7 @@ fn test_parse_function_call_multiple_arguments() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -190,7 +190,7 @@ fn test_parse_nexted_function_call() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -202,7 +202,7 @@ fn test_parse_basic_ops() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -214,7 +214,7 @@ fn test_parse_compound_ops() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -226,7 +226,7 @@ fn test_parse_compound_ops_with_function_call() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -238,7 +238,7 @@ fn test_parse_compound_ops_with_strings() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -250,7 +250,7 @@ fn test_parse_compound_ops_with_identifier() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -262,7 +262,7 @@ fn test_parse_compound_ops_with_identifier_first() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -274,7 +274,7 @@ fn test_parse_compound_ops_return() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -288,7 +288,7 @@ fn test_parse_basic_conditional() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -303,7 +303,7 @@ fn test_parse_basic_conditional_with_multiple_statements() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -320,7 +320,7 @@ fn test_parse_conditional_else_if_branch() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -339,7 +339,7 @@ fn test_parse_conditional_multiple_else_if_branch_branches() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -356,7 +356,7 @@ fn test_parse_conditional_else_branch() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -377,7 +377,7 @@ fn test_parse_conditional_elseif_else_branch() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -390,7 +390,7 @@ fn test_int_array() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -402,7 +402,7 @@ fn test_string_array() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -417,7 +417,7 @@ fn test_basic_while_loop() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -432,7 +432,7 @@ fn test_while_loop_boolean_expression() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -449,7 +449,7 @@ fn test_boolean_arithmetic() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -468,7 +468,7 @@ fn test_array_access_in_loop() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -482,7 +482,7 @@ fn test_array_access_standalone() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -497,7 +497,7 @@ fn test_array_access_assignment() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -513,7 +513,7 @@ fn test_array_access_in_if() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -526,7 +526,7 @@ fn test_uninitialized_variables() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -538,7 +538,7 @@ fn test_function_call_math() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -550,7 +550,7 @@ fn test_function_multiple_args() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -562,7 +562,7 @@ fn test_array_position_assignment() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -576,7 +576,7 @@ fn test_typed_declare() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -588,7 +588,7 @@ fn test_no_function_args_without_type() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_err()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -600,7 +600,7 @@ fn test_function_with_return_type() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()); |
|
|
|
|
assert_eq!(tree.unwrap().func[0].ret_type, Some(Type::Int)); |
|
|
|
|
} |
|
|
|
@ -617,7 +617,7 @@ fn test_booleans_in_function_call() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -637,7 +637,7 @@ fn test_late_initializing_variable() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -653,7 +653,7 @@ fn test_simple_for_loop() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -671,7 +671,7 @@ fn test_nested_for_loop() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -689,7 +689,7 @@ fn test_nested_array() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -702,7 +702,7 @@ fn test_simple_nested_expression() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -722,7 +722,7 @@ fn test_continue() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -742,7 +742,7 @@ fn test_break() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -761,7 +761,7 @@ fn test_complex_nested_expressions() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -773,7 +773,7 @@ fn test_array_as_argument() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -795,6 +795,6 @@ fn test_struct_initialization() {
|
|
|
|
|
} |
|
|
|
|
"; |
|
|
|
|
let tokens = tokenize(raw); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string())); |
|
|
|
|
let tree = parse(tokens, Some(raw.to_string()), "".into()); |
|
|
|
|
assert!(tree.is_ok()); |
|
|
|
|
} |
|
|
|
|