diff --git a/CMakeLists.txt b/CMakeLists.txt index b7f1147ed..73ba98778 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ set(TRIESTE_BUILD_SAMPLES OFF) FetchContent_Declare( trieste GIT_REPOSITORY https://github.com/microsoft/trieste - GIT_TAG main + GIT_TAG e8bf084a1f9275580db77624df031e500c910f10 GIT_SHALLOW TRUE ) diff --git a/src/lang.cc b/src/lang.cc index 3d43efa64..e21564047 100644 --- a/src/lang.cc +++ b/src/lang.cc @@ -268,13 +268,9 @@ namespace verona return opts; } - Driver& driver() + std::vector passes() { - static Driver d( - "Verona", - &options(), - parser(), - { + return { modules(), structure(), reference(), conditionals(), lambda(), autocreate(), defaultargs(), typenames(), typeview(), typefunc(), typealg(), typeflat(), @@ -283,8 +279,6 @@ namespace verona localvar(), assignment(), autofields(), autorhs(), partialapp(), traitisect(), nlrcheck(), anf(), defbeforeuse(), drop(), validtypeargs(), // typeinfer(), - }); - - return d; + }; } } diff --git a/src/lang.h b/src/lang.h index d66f2afb6..893e4e1aa 100644 --- a/src/lang.h +++ b/src/lang.h @@ -2,7 +2,7 @@ // SPDX-License-Identifier: MIT #pragma once -#include +#include namespace verona { @@ -271,12 +271,9 @@ namespace verona { bool no_std = false; - void configure(CLI::App& cli) override - { - cli.add_flag("--no-std", no_std, "Don't import the standard library."); - } + void configure(CLI::App& cli) override; }; Options& options(); - Driver& driver(); + std::vector passes(); } diff --git a/src/main.cc b/src/main.cc index 13d1e72e5..3b6b77c11 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,8 +1,23 @@ // Copyright Microsoft and Project Verona Contributors. // SPDX-License-Identifier: MIT #include "lang.h" +#include "trieste/driver.h" + +namespace verona +{ + void Options::configure(CLI::App& cli) + { + cli.add_flag("--no-std", no_std, "Don't import the standard library."); + } +} int main(int argc, char** argv) { - return verona::driver().run(argc, argv); + trieste::Driver d( + "Verona", + &verona::options(), + verona::parser(), + verona::passes()); + + return d.run(argc, argv); }