@@ -871,10 +871,19 @@ General Information)").c_str(),
871
871
}))
872
872
return false ;
873
873
874
- if (m_args.count (g_strStandardJSON))
875
- {
874
+ if (m_args.count (g_strStandardJSON) > 0 )
876
875
m_options.input .mode = InputMode::StandardJson;
876
+ else if (m_args.count (g_strAssemble) > 0 || m_args.count (g_strStrictAssembly) > 0 || m_args.count (g_strYul) > 0 )
877
+ m_options.input .mode = InputMode::Assembler;
878
+ else if (m_args.count (g_strLink) > 0 )
879
+ m_options.input .mode = InputMode::Linker;
880
+ else if (m_args.count (g_strImportAst) > 0 )
881
+ m_options.input .mode = InputMode::CompilerWithASTImport;
882
+ else
883
+ m_options.input .mode = InputMode::Compiler;
877
884
885
+ if (m_options.input .mode == InputMode::StandardJson)
886
+ {
878
887
vector<string> inputFiles;
879
888
if (m_args.count (g_strInputFile))
880
889
inputFiles = m_args[g_strInputFile].as <vector<string>>();
@@ -909,10 +918,8 @@ General Information)").c_str(),
909
918
m_options.output .evmVersion = *versionOption;
910
919
}
911
920
912
- if (m_args. count (g_strAssemble) || m_args. count (g_strStrictAssembly) || m_args. count (g_strYul) )
921
+ if (m_options. input . mode == InputMode::Assembler )
913
922
{
914
- m_options.input .mode = InputMode::Assembler;
915
-
916
923
vector<string> const nonAssemblyModeOptions = {
917
924
// TODO: The list is not complete. Add more.
918
925
g_strOutputDir,
@@ -1026,11 +1033,8 @@ General Information)").c_str(),
1026
1033
return false ;
1027
1034
}
1028
1035
1029
- if (m_args.count (g_strLink))
1030
- {
1031
- m_options.input .mode = InputMode::Linker;
1036
+ if (m_options.input .mode == InputMode::Linker)
1032
1037
return true ;
1033
- }
1034
1038
1035
1039
if (m_args.count (g_strMetadataHash))
1036
1040
{
@@ -1123,9 +1127,7 @@ General Information)").c_str(),
1123
1127
m_options.optimizer .yulSteps = m_args[g_strYulOptimizations].as <string>();
1124
1128
}
1125
1129
1126
- if (m_args.count (g_strImportAst) > 0 )
1127
- m_options.input .mode = InputMode::CompilerWithASTImport;
1128
- else
1130
+ if (m_options.input .mode == InputMode::Compiler)
1129
1131
m_options.input .errorRecovery = (m_args.count (g_strErrorRecovery) > 0 );
1130
1132
1131
1133
solAssert (m_options.input .mode == InputMode::Compiler || m_options.input .mode == InputMode::CompilerWithASTImport, " " );
0 commit comments