mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disallowed --error-recovery in Standard json, Assembly and Linker input modes
This commit is contained in:
@@ -898,13 +898,21 @@ bool CommandLineParser::processArgs()
|
||||
else
|
||||
m_options.input.mode = InputMode::Compiler;
|
||||
|
||||
if (
|
||||
m_args.count(g_strExperimentalViaIR) > 0 &&
|
||||
m_options.input.mode != InputMode::Compiler &&
|
||||
m_options.input.mode != InputMode::CompilerWithASTImport
|
||||
)
|
||||
map<string, set<InputMode>> validOptionInputModeCombinations = {
|
||||
// TODO: This should eventually contain all options.
|
||||
{g_strErrorRecovery, {InputMode::Compiler, InputMode::CompilerWithASTImport}},
|
||||
{g_strExperimentalViaIR, {InputMode::Compiler, InputMode::CompilerWithASTImport}},
|
||||
};
|
||||
vector<string> invalidOptionsForCurrentInputMode;
|
||||
for (auto const& [optionName, inputModes]: validOptionInputModeCombinations)
|
||||
{
|
||||
serr() << "The option --" << g_strExperimentalViaIR << " is only supported in the compiler mode." << endl;
|
||||
if (m_args.count(optionName) > 0 && inputModes.count(m_options.input.mode) == 0)
|
||||
invalidOptionsForCurrentInputMode.push_back(optionName);
|
||||
}
|
||||
|
||||
if (!invalidOptionsForCurrentInputMode.empty())
|
||||
{
|
||||
serr() << "The following options are not supported in the current input mode: " << joinOptionNames(invalidOptionsForCurrentInputMode) << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user