summaryrefslogtreecommitdiff
path: root/src/initial_check.mli
diff options
context:
space:
mode:
authorAlasdair Armstrong2018-12-05 20:49:38 +0000
committerAlasdair Armstrong2018-12-06 15:00:51 +0000
commit272d9565ef7f48baa0982a291c7fde8497ab0cd9 (patch)
treec12acabfab2592f641430fd7a1f1c02512d8c90c /src/initial_check.mli
parentdf3ea2e6da387ead7cba1e27632768e563696502 (diff)
Re-factor initial check
Mostly this is to change how we desugar types in order to make us more flexible with what we can parse as a valid constraint as type. Previously the structure of the initial check forced some awkward limitations on what was parseable due to how the parse AST is set up. As part of this, I've taken the de-scattering of scattered functions out of the initial check, and moved it to a re-writing step after type-checking, where I think it logically belongs. This doesn't change much right now, but opens up some more possibilities in the future: Since scattered functions are now typechecked normally, any future module system for Sail would be able to handle them specially, and the Latex documentation backend can now document scattered functions explicitly, rather than relying on hackish 'de-scattering' logic to present documentation as the functions originally appeared. This has one slight breaking change which is that union clauses must appear before their uses in scattered functions, so union ast = Foo : unit function clause execute(Foo()) is ok, but function clause execute(Foo()) union ast = Foo : unit is not. Previously this worked because the de-scattering moved union clauses upwards before type-checking, but as this now happens after type-checking they must appear in the correct order. This doesn't occur in ARM, RISC-V, MIPS, but did appear in Cheri and I submitted a pull request to re-order the places where it happens.
Diffstat (limited to 'src/initial_check.mli')
-rw-r--r--src/initial_check.mli6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/initial_check.mli b/src/initial_check.mli
index e6b29216..32def316 100644
--- a/src/initial_check.mli
+++ b/src/initial_check.mli
@@ -87,7 +87,7 @@ val process_ast : order -> Parse_ast.defs -> unit defs
val val_spec_ids : 'a defs -> IdSet.t
-val extern_of_string : order -> id -> string -> unit def
-val val_spec_of_string : order -> id -> string -> unit def
+val extern_of_string : id -> string -> unit def
+val val_spec_of_string : id -> string -> unit def
-val exp_of_string : order -> string -> unit exp
+val exp_of_string : string -> unit exp