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