Add no-op support for the experimental_strip_nonfunctional_codegen parameter.
This will be used for codegen tests to verify that an editions upgrade hasn't changed anything meaningful. PiperOrigin-RevId: 608660846pull/15876/head
parent
038007e748
commit
e26193d168
|
@ -1106,6 +1106,8 @@ bool ParseOptions(Plugin* plugin, Options* options) {
|
|||
for (const auto& pair : ParseGeneratorParameter(plugin->parameter())) {
|
||||
if (pair.first == "bootstrap_upb") {
|
||||
options->bootstrap = true;
|
||||
} else if (pair.first == "experimental_strip_nonfunctional_codegen") {
|
||||
continue;
|
||||
} else {
|
||||
plugin->SetError(absl::Substitute("Unknown parameter: $0", pair.first));
|
||||
return false;
|
||||
|
|
|
@ -42,10 +42,13 @@ void GenerateFile(const DefPoolPair& pools, upb::FileDefPtr file,
|
|||
}
|
||||
|
||||
bool ParseOptions(Plugin* plugin) {
|
||||
const auto param = ParseGeneratorParameter(plugin->parameter());
|
||||
if (!param.empty()) {
|
||||
plugin->SetError(absl::Substitute("Unknown parameter: $0", param[0].first));
|
||||
return false;
|
||||
for (const auto& pair : ParseGeneratorParameter(plugin->parameter())) {
|
||||
if (pair.first == "experimental_strip_nonfunctional_codegen") {
|
||||
continue;
|
||||
} else {
|
||||
plugin->SetError(absl::Substitute("Unknown parameter: $0", pair.first));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue