diff options
author | Nadrieril | 2024-06-18 11:31:45 +0200 |
---|---|---|
committer | Nadrieril | 2024-06-18 12:11:23 +0200 |
commit | aa5948d7f9fd9b2d0ce18657215dae6877ebd996 (patch) | |
tree | 56008c815bfc43c3c63ef31489a853241983d87d /compiler/Errors.ml | |
parent | 43a9fb0fa5a1c03a7cce575a052f0d4201189d1d (diff) |
Tiny dedup
Diffstat (limited to 'compiler/Errors.ml')
-rw-r--r-- | compiler/Errors.ml | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/Errors.ml b/compiler/Errors.ml index 6e2de7e1..838e1e37 100644 --- a/compiler/Errors.ml +++ b/compiler/Errors.ml @@ -1,7 +1,6 @@ let log = Logging.errors_log -let span_to_string (span : Meta.span) = - let raw_span = span.span in +let raw_span_to_string (raw_span : Meta.raw_span) = let file = match raw_span.file with Virtual s | Local s -> s in let loc_to_string (l : Meta.loc) : string = string_of_int l.line ^ ":" ^ string_of_int l.col @@ -11,6 +10,8 @@ let span_to_string (span : Meta.span) = ^ "-" ^ loc_to_string raw_span.end_loc +let span_to_string (span : Meta.span) = raw_span_to_string span.span + let format_error_message (span : Meta.span option) (msg : string) = let span = match span with None -> "" | Some span -> "\n" ^ span_to_string span |