diff --git a/env/env.h b/env/env.h index 9830b67d7..673ab19e4 100644 --- a/env/env.h +++ b/env/env.h @@ -59,6 +59,8 @@ class Env { void SetConfig(const Config& config) { config_ = config; } + CompilerOptions& GetCompilerOptions() { return compiler_options_; } + absl::StatusOr> NewCompilerBuilder(); // Shortcut for NewCompilerBuilder() followed by Build(). diff --git a/env/env_test.cc b/env/env_test.cc index 00143a857..bca57ad68 100644 --- a/env/env_test.cc +++ b/env/env_test.cc @@ -662,5 +662,16 @@ std::vector GetFunctionConfigTestCases() { INSTANTIATE_TEST_SUITE_P(FunctionConfigTest, FunctionConfigTest, ::testing::ValuesIn(GetFunctionConfigTestCases())); +TEST(EnvTest, GetCompilerOptions) { + Env env; + EXPECT_TRUE( + env.GetCompilerOptions().parser_options.enable_quoted_identifiers); + EXPECT_TRUE(env.GetCompilerOptions().adapt_parser_errors); + + env.GetCompilerOptions().parser_options.enable_quoted_identifiers = false; + EXPECT_FALSE( + env.GetCompilerOptions().parser_options.enable_quoted_identifiers); +} + } // namespace } // namespace cel