Skip to content

Commit

Permalink
Clippy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
azdavis committed Nov 30, 2023
1 parent df6c0cc commit 2aceda9
Show file tree
Hide file tree
Showing 64 changed files with 1,191 additions and 1,191 deletions.
4 changes: 2 additions & 2 deletions crates/millet-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fn usage() {
.unwrap_or_else(|| "<unknown>".to_owned());
println!("usage:");
println!(" {current_exe_name} [options] <path>");
let rest_of_usage = r#"
let rest_of_usage = r"
options:
-h, --help
show this help
Expand All @@ -25,7 +25,7 @@ arguments:
path of the project to analyze. the path is a directory containing either:
- a single .cm or .mlb file
- a millet.toml config file
"#;
";
print!("{rest_of_usage}");
}

Expand Down
4 changes: 2 additions & 2 deletions crates/mlb-statics/src/std_basis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ impl StdBasis {
}

const STREAM_IO_REGULAR: &str = " structure StreamIO : STREAM_IO";
const STREAM_IO_TEXT: &str = r#" structure StreamIO : TEXT_STREAM_IO
const STREAM_IO_TEXT: &str = r" structure StreamIO : TEXT_STREAM_IO
where type reader = TextPrimIO.reader
where type writer = TextPrimIO.writer
where type pos = TextPrimIO.pos
"#;
";
const INCLUDE_IMPERATIVE_IO_HACK: &str = " include IMPERATIVE_IO_HACK";

fn get_std_basis<I>(files: I) -> StdBasis
Expand Down
120 changes: 60 additions & 60 deletions crates/sml-dynamics-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,38 +98,38 @@ fn rm_whitespace(s: &str) -> String {
#[test]
fn builtin_add() {
check(
r#"
r"
val inc = fn x => 1 + x
val three = inc 2
"#,
",
&[
r#"
r"
val inc = fn x => + (1, x)
val three = inc 2
"#,
r#"
",
r"
val three = inc 2
"#,
r#"
",
r"
val three = (fn x => + (1, x)) 2
"#,
r#"
",
r"
val three = + (1, x)
"#,
r#"
",
r"
val three = + (1, 2)
"#,
r#"
",
r"
val three = 3
"#,
",
],
);
}

#[test]
fn nat_add() {
check(
r#"
r"
datatype nat = Z | S of nat
fun add a b =
Expand All @@ -138,9 +138,9 @@ fun add a b =
| S x => S (add x b)
val four = add (S Z) (S (S (S Z)))
"#,
",
&[
r#"
r"
datatype ...
val rec add = fn '0 => fn '1 =>
Expand All @@ -154,8 +154,8 @@ val rec add = fn '0 => fn '1 =>
val four = add
(S Z)
(S (S (S Z)))
"#,
r#"
",
r"
val rec add = fn '0 => fn '1 =>
(fn (a, b) =>
(fn
Expand All @@ -167,13 +167,13 @@ val rec add = fn '0 => fn '1 =>
val four = add
(S Z)
(S (S (S Z)))
"#,
r#"
",
r"
val four = add
(S Z)
(S (S (S Z)))
"#,
r#"
",
r"
val four =
(
fn '0 => fn '1 =>
Expand All @@ -186,9 +186,9 @@ val four =
)
(S Z)
(S (S (S Z)))
"#,
",
// lazy substitution
r#"
r"
val four =
(
fn '1 =>
Expand All @@ -200,53 +200,53 @@ val four =
) ('0, '1)
)
(S (S (S Z)))
"#,
r#"
",
r"
val four =
(fn (a, b) =>
(fn
Z => b
| S x => S (add x b)
) a
) ('0, '1)
"#,
r#"
",
r"
val four =
(fn (a, b) =>
(fn
Z => b
| S x => S (add x b)
) a
) (S Z, '1)
"#,
r#"
",
r"
val four =
(fn (a, b) =>
(fn
Z => b
| S x => S (add x b)
) a
) (S Z, S (S (S Z)))
"#,
r#"
",
r"
val four =
(fn
Z => b
| S x => S (add x b)
) a
"#,
r#"
",
r"
val four =
(fn
Z => b
| S x => S (add x b)
) (S Z)
"#,
r#"
",
r"
val four =
S (add x b)
"#,
r#"
",
r"
val four =
S (
(
Expand All @@ -261,8 +261,8 @@ val four =
x
b
)
"#,
r#"
",
r"
val four =
S (
(
Expand All @@ -277,8 +277,8 @@ val four =
Z
b
)
"#,
r#"
",
r"
val four =
S (
(
Expand All @@ -292,8 +292,8 @@ val four =
)
b
)
"#,
r#"
",
r"
val four =
S (
(
Expand All @@ -307,8 +307,8 @@ val four =
)
(S (S (S Z)))
)
"#,
r#"
",
r"
val four =
S (
(fn (a, b) =>
Expand All @@ -318,8 +318,8 @@ val four =
) a
) ('0, '1)
)
"#,
r#"
",
r"
val four =
S (
(fn (a, b) =>
Expand All @@ -329,8 +329,8 @@ val four =
) a
) (Z, '1)
)
"#,
r#"
",
r"
val four =
S (
(fn (a, b) =>
Expand All @@ -340,33 +340,33 @@ val four =
) a
) (Z, S (S (S Z)))
)
"#,
r#"
",
r"
val four =
S (
(fn
Z => b
| S x => S (add x b)
) a
)
"#,
r#"
",
r"
val four =
S (
(fn
Z => b
| S x => S (add x b)
) Z
)
"#,
r#"
",
r"
val four =
S b
"#,
r#"
",
r"
val four =
S (S (S (S Z)))
"#,
",
],
);
}
24 changes: 12 additions & 12 deletions crates/tests/src/big.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,29 @@ shiina = { workspace-path = "mayuri" }
),
(
"rintarou.sml",
r#"
r"
structure R = struct
val date = 20100728
end
"#,
",
),
(
"hw1/mayuri.sml",
r#"
r"
structure M = struct
val idx = 2
end
"#,
",
),
(
"hw1/sources.cm",
r#"
r"
Group is
a.sml
b.sml
$shiina.sml
$okabe.sml
"#,
",
),
(
"hw1/a.sml",
Expand All @@ -53,11 +53,11 @@ end
),
(
"hw1/b.sml",
r#"
r"
val _ = A.bird
val _ = M.idx + 1 + R.date
"#,
",
),
(
"hw2/mayuri.sml",
Expand All @@ -69,13 +69,13 @@ end
),
(
"hw2/sources.cm",
r#"
r"
Group is
c.sml
$shiina.sml
$okabe.sml
d.sml
"#,
",
),
(
"hw2/d.sml",
Expand All @@ -89,9 +89,9 @@ val _ = (if M.msg = "E" then 1 else 2) + R.date
),
(
"hw2/c.sml",
r#"
r"
val _ = D.sound
"#,
",
),
];
check_multi(files);
Expand Down
Loading

0 comments on commit 2aceda9

Please sign in to comment.