From 31d4c63134e6a1f6425a8f8abe9565efa9e7b933 Mon Sep 17 00:00:00 2001 From: Marcel Garus Date: Thu, 1 Feb 2024 20:46:34 +0100 Subject: [PATCH 1/2] Fix typo --- compiler/frontend/src/string_to_rcst/function.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/frontend/src/string_to_rcst/function.rs b/compiler/frontend/src/string_to_rcst/function.rs index fff2e322a..52e327083 100644 --- a/compiler/frontend/src/string_to_rcst/function.rs +++ b/compiler/frontend/src/string_to_rcst/function.rs @@ -15,7 +15,7 @@ pub fn function(input: &str, indentation: usize) -> Option<(&str, Rcst)> { let (input, opening_curly_brace) = opening_curly_brace(input)?; let (input, mut opening_curly_brace, mut parameters_and_arrow) = { let input_without_params = input; - let opening_curly_brace_wihout_params = opening_curly_brace.clone(); + let opening_curly_brace_without_params = opening_curly_brace.clone(); let mut input = input; let mut opening_curly_brace = opening_curly_brace; @@ -50,7 +50,7 @@ pub fn function(input: &str, indentation: usize) -> Option<(&str, Rcst)> { Some((input, arrow)) => (input, opening_curly_brace, Some((parameters, arrow))), None => ( input_without_params, - opening_curly_brace_wihout_params, + opening_curly_brace_without_params, None, ), } From 07d45cd8bb51a93fc88d607aa40a04ab0ebb6dea Mon Sep 17 00:00:00 2001 From: Marcel Garus Date: Thu, 1 Feb 2024 20:46:45 +0100 Subject: [PATCH 2/2] Allow comment after = in assignment --- compiler/frontend/src/string_to_rcst/expression.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/frontend/src/string_to_rcst/expression.rs b/compiler/frontend/src/string_to_rcst/expression.rs index ed29d3b0f..51d0c64e4 100644 --- a/compiler/frontend/src/string_to_rcst/expression.rs +++ b/compiler/frontend/src/string_to_rcst/expression.rs @@ -326,7 +326,7 @@ fn expression_suffix_assignment<'a>( let just_the_assignment_sign = assignment_sign.clone(); let input_after_assignment_sign = input; - let (input, more_whitespace) = whitespaces_and_newlines(input, indentation + 1, false); + let (input, more_whitespace) = whitespaces_and_newlines(input, indentation + 1, true); assignment_sign = assignment_sign.wrap_in_whitespace(more_whitespace); let is_multiline = left.is_multiline() || assignment_sign.is_multiline();