From 1b292bad85ab03ff5a63d8ac72044bae29209ac3 Mon Sep 17 00:00:00 2001 From: Ariel Davis Date: Sun, 6 Aug 2023 22:41:35 -0700 Subject: [PATCH] Rm unsupported --- crates/sml-hir-lower/src/dec.rs | 3 ++- crates/sml-hir-lower/src/util.rs | 4 ---- .../deviations/successor_ml/withtype_spec.rs | 2 +- docs/diagnostics/4029.md | 2 ++ docs/diagnostics/4999.md | 24 ------------------- 5 files changed, 5 insertions(+), 30 deletions(-) delete mode 100644 docs/diagnostics/4999.md diff --git a/crates/sml-hir-lower/src/dec.rs b/crates/sml-hir-lower/src/dec.rs index 8e26ac28d..7503aa2c1 100644 --- a/crates/sml-hir-lower/src/dec.rs +++ b/crates/sml-hir-lower/src/dec.rs @@ -360,7 +360,8 @@ fn get_spec_one(st: &mut St<'_>, dec: Option) -> Vec) -> fmt::Result { match &self.kind { - ErrorKind::Unsupported(s) => write!(f, "unsupported: {s}"), ErrorKind::FunBindMismatchedName(want, got) => { write!(f, "expected a function clause for `{want}`, found one for `{got}`") } @@ -236,7 +233,6 @@ impl Error { #[must_use] pub fn code(&self) -> Code { match self.kind { - ErrorKind::Unsupported(_) => Code::n(4999), ErrorKind::FunBindMismatchedName(_, _) => Code::n(4001), ErrorKind::FunBindWrongNumPats(_, _) => Code::n(4002), ErrorKind::InvalidIntLit(_) | ErrorKind::InvalidWordLit(_) => Code::n(4003), diff --git a/crates/tests/src/deviations/successor_ml/withtype_spec.rs b/crates/tests/src/deviations/successor_ml/withtype_spec.rs index 9e8297feb..d3dd7f24f 100644 --- a/crates/tests/src/deviations/successor_ml/withtype_spec.rs +++ b/crates/tests/src/deviations/successor_ml/withtype_spec.rs @@ -10,7 +10,7 @@ signature STREAM = sig datatype 'a u = Nil | Cons of 'a * 'a t withtype 'a t = unit -> 'a u -(** ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsupported: `withtype` in specifications *) +(** ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `withtype` in specifications *) end "#, ); diff --git a/docs/diagnostics/4029.md b/docs/diagnostics/4029.md index 8af9467fd..7ec01b461 100644 --- a/docs/diagnostics/4029.md +++ b/docs/diagnostics/4029.md @@ -9,3 +9,5 @@ The language construct may have been explicitly disallowed in `millet.toml`, or Either allow the thing in `millet.toml`, or remove the occurrence of the thing from the code. Consult [the manual](/docs/manual.md#language) to see how to edit your `millet.toml` to allow the item. + +Some constructs may not be allowable because support for them in Millet is not implemented. diff --git a/docs/diagnostics/4999.md b/docs/diagnostics/4999.md deleted file mode 100644 index 6392f792c..000000000 --- a/docs/diagnostics/4999.md +++ /dev/null @@ -1,24 +0,0 @@ -# 4999 - -There was an occurrence of an unsupported SML construct. - -```sml -val x = #[1, 2] -(** ^^^^^^^ unsupported: vector expressions *) -``` - -At time of writing, Millet does not support the following constructs: - -| Name | Example | -| ---------------------------- | ------------------------- | -| Vector expressions | `val _ = #[1, 2]` | -| Vector patterns | `fn #[1, 2] => 3` | -| Do declarations | `do print "hello"` | -| Expression row punning | `val _ = {a, b}` | -| `withtype` in specifications | (same as in declarations) | - -Note that these constructs are not defined by the Definition, but are extensions provided in some implementations like SML/NJ and MLton. - -## To fix - -Avoid such constructs.