Skip to content

Commit 2c452d8

Browse files
committed
Merge branch 'v0.2-beta' into 'main'
Some quick fixes for 0.2.45 See merge request mech-lang/mech!118
2 parents 3ec30fe + d74ebe9 commit 2c452d8

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

include/style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ body {
2525

2626
.mech-content {
2727
min-width: 800px;
28+
padding-top: 20px;
29+
padding-bottom: 20px;
2830
counter-reset: h2 equation;
2931
flex: 2;
3032
}
@@ -46,6 +48,7 @@ body {
4648
background-color: #171D21;
4749
color: #f2ead9;
4850
overflow-y: auto;
51+
overflow-x: hidden;
4952
position: sticky;
5053
top: 0;
5154
height: 100vh;
@@ -417,6 +420,7 @@ h4.toc {
417420
}
418421

419422
.mech-statement {
423+
min-width: 225px;
420424
}
421425

422426
.mech-variable-define {

src/syntax/src/formatter.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -693,20 +693,25 @@ window.addEventListener("scroll", () => {{
693693

694694
pub fn fenced_mech_code(&mut self, node: &Vec<(MechCode, Option<Comment>)>, interpreter_id: &u64) -> String {
695695
self.interpreter_id = *interpreter_id;
696-
let mut src = "".to_string();
696+
let mut src = String::new();
697697
for (code,cmmnt) in node {
698698
let c = match code {
699+
MechCode::Comment(cmnt) => self.comment(cmnt),
699700
MechCode::Expression(expr) => self.expression(expr),
701+
//MechCode::FsmSpecification(fsm_spec) => self.fsm_specification(fsm_spec),
702+
//MechCode::FsmImplementation(fsm_impl) => self.fsm_implementation(fsm_impl),
703+
//MechCode::FunctionDefine(func_def) => self.function_define(func_def),
700704
MechCode::Statement(stmt) => self.statement(stmt),
701-
MechCode::FsmSpecification(fsm_spec) => self.fsm_specification(fsm_spec),
702-
MechCode::FsmImplementation(fsm_impl) => self.fsm_implementation(fsm_impl),
703-
MechCode::Comment(cmnt) => self.comment(cmnt),
704705
_ => todo!(),
705706
};
707+
let formatted_comment = match cmmnt {
708+
Some(cmmt) => self.comment(cmmt),
709+
None => String::new(),
710+
};
706711
if self.html {
707-
src.push_str(&format!("<div class=\"mech-code\">{}</div>", c));
712+
src.push_str(&format!("<span class=\"mech-code\">{}{}</span>", c, formatted_comment));
708713
} else {
709-
src.push_str(&format!("{}\n", c));
714+
src.push_str(&format!("{}{}\n", c, formatted_comment));
710715
}
711716
}
712717
self.interpreter_id = 0;

0 commit comments

Comments
 (0)