Skip to content

Commit 67f4fd3

Browse files
committed
将模式R变更为r, 原R模式会在此基础上将标签向下构建
1 parent b54b79e commit 67f4fd3

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mindustry_logic_bang_lang"
3-
version = "0.10.4"
3+
version = "0.10.5"
44
edition = "2021"
55

66
authors = ["A4-Tacks <wdsjxhno1001@163.com>"]

src/main.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ pub const HELP_MSG: &str = concat_lines! {
5353
"\t", "T: compile MdtBangLang to MdtTagCode (Builded TagDown)";
5454
"\t", "f: compile MdtLogicCode to MdtTagCode";
5555
"\t", "F: compile MdtLogicCode to MdtTagCode (Builded TagDown)";
56-
"\t", "R: compile MdtLogicCode to MdtBangLang";
56+
"\t", "r: compile MdtLogicCode to MdtBangLang";
57+
"\t", "R: compile MdtLogicCode to MdtBangLang (Builded TagDown)";
5758
"\t", "C: compile MdtTagCode to MdtLogicCode";
5859
;
5960
"input from stdin";
@@ -150,9 +151,13 @@ fn main() {
150151
println!("{}", line);
151152
}
152153
},
153-
"R" => {
154+
tag @ ("r" | "R") => {
154155
match TagCodes::from_str(&read_stdin()) {
155-
Ok(lines) => {
156+
Ok(mut lines) => {
157+
if tag == "R" {
158+
lines.build_tagdown().unwrap();
159+
lines.tag_up();
160+
}
156161
let ast = Expand::try_from(&lines)
157162
.unwrap_or_else(|(idx, e)| {
158163
let lines_str = lines.iter()

0 commit comments

Comments
 (0)