Fix: mappings
This commit is contained in:
@@ -2,9 +2,7 @@ WHITESPACE = _{ " " | "\t" | "\r" | "\n" }
|
||||
|
||||
integer = @{ ASCII_DIGIT+ }
|
||||
|
||||
next_line = { "+" }
|
||||
|
||||
map = { "/*" ~ integer ~ ":" ~ integer ~ next_line? ~ "*/" }
|
||||
map = { "/*" ~ integer ~ ":" ~ integer ~ "*/" }
|
||||
|
||||
non_map = { (!map ~ ANY)+ }
|
||||
|
||||
|
||||
@@ -32,17 +32,7 @@ pub fn get_mapping(input: &str) -> HashSet<(RustMap, MistMap)> {
|
||||
inner.next().unwrap().as_str().parse().unwrap(),
|
||||
);
|
||||
|
||||
mapping.insert((
|
||||
RustMap(rs.0, rs.1),
|
||||
MistMap(
|
||||
if inner.next().is_some() {
|
||||
line
|
||||
} else {
|
||||
line - 1
|
||||
},
|
||||
col,
|
||||
),
|
||||
));
|
||||
mapping.insert((RustMap(rs.0, rs.1), MistMap(line, col)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -131,7 +131,7 @@ pub fn print_diagnostics(diagnostics: &Vec<MistDiagnostic>) {
|
||||
println!(
|
||||
"\n{}:{}:{}\n \x1b[31mError\x1b[0m: {}\n\t{}",
|
||||
msg.file_name,
|
||||
msg.line + 1,
|
||||
msg.line,
|
||||
msg.column,
|
||||
msg.message,
|
||||
line.unwrap_or_default(),
|
||||
@@ -144,7 +144,7 @@ pub fn print_diagnostics(diagnostics: &Vec<MistDiagnostic>) {
|
||||
println!(
|
||||
"\n{}:{}:{}\n \x1b[33mWarning\x1b[0m: {}\n\t{}",
|
||||
msg.file_name,
|
||||
msg.line + 1,
|
||||
msg.line,
|
||||
msg.column,
|
||||
msg.message,
|
||||
line.unwrap_or_default(),
|
||||
|
||||
Reference in New Issue
Block a user