mirror of
https://github.com/HigherOrderCO/Bend.git
synced 2024-11-05 04:51:40 +03:00
Fix extra slash at end of path
This commit is contained in:
parent
2b3ec9853a
commit
29177fa52d
@ -64,9 +64,8 @@ pub fn error_to_msg(err: &Rich<'_, Token>, code: &str, path: &Path) -> String {
|
||||
RichReason::Many(errs) => &errs[0],
|
||||
_ => err.reason(),
|
||||
};
|
||||
let mut path = path.to_path_buf();
|
||||
path.push(format!(":{lin}:{col}"));
|
||||
format!("At {}: {}\n{}", path.display(), reason, highlight_error::highlight_error(start, end, code))
|
||||
let path = format!("{}:{lin}:{col}", path.display());
|
||||
format!("At {}: {}\n{}", path, reason, highlight_error::highlight_error(start, end, code))
|
||||
}
|
||||
|
||||
fn line_and_col_of_byte(until: usize, src: &str) -> (usize, usize) {
|
||||
|
@ -2,5 +2,5 @@
|
||||
source: tests/golden_tests.rs
|
||||
input_file: tests/golden_tests/compile_file/just_a_name.hvm
|
||||
---
|
||||
At tests/golden_tests/compile_file/just_a_name.hvm/:1:1: found 'asdf' expected '+', '(', '[', or '='
|
||||
At tests/golden_tests/compile_file/just_a_name.hvm:1:1: found 'asdf' expected '+', '(', '[', or '='
|
||||
[0m 1 | [4m[31masdf[0m
|
||||
|
@ -2,5 +2,5 @@
|
||||
source: tests/golden_tests.rs
|
||||
input_file: tests/golden_tests/compile_file_o_all/adt_string.hvm
|
||||
---
|
||||
At tests/golden_tests/compile_file_o_all/adt_string.hvm/:1:1: String is a built-in datatype and should not be overridden.
|
||||
At tests/golden_tests/compile_file_o_all/adt_string.hvm:1:1: String is a built-in datatype and should not be overridden.
|
||||
[0m 1 | [4m[31mdata String = S[0m
|
||||
|
@ -2,5 +2,5 @@
|
||||
source: tests/golden_tests.rs
|
||||
input_file: tests/golden_tests/parse_file/missing_paren.hvm
|
||||
---
|
||||
At tests/golden_tests/parse_file/missing_paren.hvm/:1:7: Missing Parenthesis around rule body
|
||||
At tests/golden_tests/parse_file/missing_paren.hvm:1:7: Missing Parenthesis around rule body
|
||||
[0m 1 | main = [4m[31m* *[0m
|
||||
|
@ -2,5 +2,5 @@
|
||||
source: tests/golden_tests.rs
|
||||
input_file: tests/golden_tests/parse_file/missing_paren_then_adt.hvm
|
||||
---
|
||||
At tests/golden_tests/parse_file/missing_paren_then_adt.hvm/:1:7: Missing Parenthesis around rule body
|
||||
At tests/golden_tests/parse_file/missing_paren_then_adt.hvm:1:7: Missing Parenthesis around rule body
|
||||
[0m 1 | main = [4m[31m* * * *[0m
|
||||
|
@ -2,7 +2,7 @@
|
||||
source: tests/golden_tests.rs
|
||||
input_file: tests/golden_tests/parse_file/multiple_parsing_errors.hvm
|
||||
---
|
||||
At tests/golden_tests/parse_file/multiple_parsing_errors.hvm/:3:7: Missing Parenthesis around rule body
|
||||
At tests/golden_tests/parse_file/multiple_parsing_errors.hvm:3:7: Missing Parenthesis around rule body
|
||||
[0m 3 | main = [4m[31mA B[0m
|
||||
At tests/golden_tests/parse_file/multiple_parsing_errors.hvm/:5:0: Repeated datatype 'Foo'
|
||||
At tests/golden_tests/parse_file/multiple_parsing_errors.hvm:5:0: Repeated datatype 'Foo'
|
||||
[0m 5 | [4m[31mdata Foo = B[0m
|
||||
|
@ -2,5 +2,5 @@
|
||||
source: tests/golden_tests.rs
|
||||
input_file: tests/golden_tests/parse_file/repeated_adt_name.hvm
|
||||
---
|
||||
At tests/golden_tests/parse_file/repeated_adt_name.hvm/:2:0: Repeated datatype 'Foo'
|
||||
At tests/golden_tests/parse_file/repeated_adt_name.hvm:2:0: Repeated datatype 'Foo'
|
||||
[0m 2 | [4m[31mdata Foo = B[0m
|
||||
|
@ -2,9 +2,9 @@
|
||||
source: tests/golden_tests.rs
|
||||
input_file: tests/golden_tests/run_file/names_hyphen_toplevel.hvm
|
||||
---
|
||||
At tests/golden_tests/run_file/names_hyphen_toplevel.hvm/:1:1: Names with '-' are not supported at top level.
|
||||
At tests/golden_tests/run_file/names_hyphen_toplevel.hvm:1:1: Names with '-' are not supported at top level.
|
||||
[0m 1 | [4m[31mthis-is-not-allowed[0m = 1[0m
|
||||
At tests/golden_tests/run_file/names_hyphen_toplevel.hvm/:3:5: Names with '-' are not supported at top level.
|
||||
At tests/golden_tests/run_file/names_hyphen_toplevel.hvm:3:5: Names with '-' are not supported at top level.
|
||||
[0m 3 | data [4m[31mFoo-Bar[0m = Baz-Qux[0m
|
||||
At tests/golden_tests/run_file/names_hyphen_toplevel.hvm/:3:15: Names with '-' are not supported at top level.
|
||||
At tests/golden_tests/run_file/names_hyphen_toplevel.hvm:3:15: Names with '-' are not supported at top level.
|
||||
[0m 3 | data Foo-Bar = [4m[31mBaz-Qux[0m
|
||||
|
@ -2,6 +2,6 @@
|
||||
source: tests/golden_tests.rs
|
||||
input_file: tests/golden_tests/run_file/override_list_ctr.hvm
|
||||
---
|
||||
At tests/golden_tests/run_file/override_list_ctr.hvm/:1:1: LNil is a built-in constructor and should not be overridden.
|
||||
At tests/golden_tests/run_file/override_list_ctr.hvm:1:1: LNil is a built-in constructor and should not be overridden.
|
||||
[0m 1 | [4m[31mdata Override
|
||||
[0m 2 | [4m[31m = LNil[0m
|
||||
|
@ -2,6 +2,6 @@
|
||||
source: tests/golden_tests.rs
|
||||
input_file: tests/golden_tests/run_file/override_str_ctr.hvm
|
||||
---
|
||||
At tests/golden_tests/run_file/override_str_ctr.hvm/:1:1: SCons is a built-in constructor and should not be overridden.
|
||||
At tests/golden_tests/run_file/override_str_ctr.hvm:1:1: SCons is a built-in constructor and should not be overridden.
|
||||
[0m 1 | [4m[31mdata Override
|
||||
[0m 2 | [4m[31m = (SCons any)[0m
|
||||
|
Loading…
Reference in New Issue
Block a user