diff --git a/Cargo.lock b/Cargo.lock index 3ce20d5..1c0217d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -307,7 +307,7 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "mindustry_logic_bang_lang" -version = "0.17.0" +version = "0.17.1" dependencies = [ "display_source", "logic_lint", @@ -580,7 +580,7 @@ dependencies = [ [[package]] name = "tag_code" -version = "0.2.0" +version = "0.2.1" dependencies = [ "either", "peg", diff --git a/Cargo.toml b/Cargo.toml index 442549b..90add1a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mindustry_logic_bang_lang" -version = "0.17.0" +version = "0.17.1" edition = "2021" authors = ["A4-Tacks "] diff --git a/tools/tag_code/Cargo.toml b/tools/tag_code/Cargo.toml index 88aa9d5..6fbc154 100644 --- a/tools/tag_code/Cargo.toml +++ b/tools/tag_code/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tag_code" -version = "0.2.0" +version = "0.2.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/tools/tag_code/src/logic_parser.rs b/tools/tag_code/src/logic_parser.rs index 6aae517..eec0e75 100644 --- a/tools/tag_code/src/logic_parser.rs +++ b/tools/tag_code/src/logic_parser.rs @@ -307,12 +307,19 @@ impl<'a> Display for ParseLine<'a> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { ParseLine::Label(lab) => { + if let Some('0'..='9') = lab.chars().next() { + f.write_str(":")?; + } f.write_str(&*lab)?; f.write_str(":") }, ParseLine::Jump(target, args) => { if f.alternate() { f.write_str(" ")? } - f.write_fmt(format_args!("jump {target} {args}")) + f.write_str("jump ")?; + if let Some('0'..='9') = target.chars().next() { + f.write_str(":")?; + } + f.write_fmt(format_args!("{target} {args}")) }, ParseLine::Args(args) => { if f.alternate() { f.write_str(" ")? }