From 0bec0a4bbaf4859bb4c7a2f1c4ecda60ccab72f2 Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Fri, 15 Oct 2021 17:37:23 -0700 Subject: Add a --structural flag (#4252) Just as the --nominal flag forces all types to be parsed as nominal, the --structural flag forces all types to be parsed as equirecursive. This is the current default behavior, but a future PR will change the default to parse types as either structural or nominal according to their syntax or encoding. This new flag will then be necessary to get the current behavior. Also take this opportunity to deduplicate more flags in the help tests. --- src/tools/tool-options.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/tools/tool-options.h b/src/tools/tool-options.h index 4b589b5b2..a73d72d09 100644 --- a/src/tools/tool-options.h +++ b/src/tools/tool-options.h @@ -112,11 +112,18 @@ struct ToolOptions : public Options { }) .add("--nominal", "", - "Use the prototype nominal type system instead of the normal " - "equirecursive type system.", + "Force all GC type definitions to be parsed as nominal.", Options::Arguments::Zero, [](Options* o, const std::string& argument) { setTypeSystem(TypeSystem::Nominal); + }) + .add("--structural", + "", + "Force all GC type definitions to be parsed as structural " + "(i.e. equirecursive). This is the default.", + Options::Arguments::Zero, + [](Options* o, const std::string& argument) { + setTypeSystem(TypeSystem::Equirecursive); }); } -- cgit v1.2.3