diff --git a/es2panda/aot/options.cpp b/es2panda/aot/options.cpp index 0a5a9c83a23aeb087c52889517cfd8f824047f56..35ada4f882d028f012f93777f0acae11a2fdcc5c 100644 --- a/es2panda/aot/options.cpp +++ b/es2panda/aot/options.cpp @@ -97,9 +97,10 @@ bool Options::CollectInputFilesFromFileList(const std::string &input, const std: std::string line; ifs.open(panda::os::file::File::GetExtendedFilePath(input)); if (!ifs.is_open()) { - std::cerr << "Failed to open source list file '" << input << "' during input file collection." << std::endl - << "Please check if the file exists or the path is correct, " - << "and you have the necessary permissions to access it." << std::endl; + std::cerr << "Failed to open source list file '" << input << + "' during input file collection." << std::endl << + "Please check if the file exists or the path is correct, " << + "and you have the necessary permissions to access it." << std::endl; return false; } @@ -109,11 +110,11 @@ bool Options::CollectInputFilesFromFileList(const std::string &input, const std: std::vector itemList = GetStringItems(line, LIST_ITEM_SEPERATOR); if ((compilerOptions_.mergeAbc && itemList.size() != ITEM_COUNT_MERGE) || (!compilerOptions_.mergeAbc && itemList.size() != ITEM_COUNT_NOT_MERGE)) { - std::cerr << "Failed to parse line " << line << " of the input file: '" - << input << "'." << std::endl - << "Expected " << (compilerOptions_.mergeAbc ? ITEM_COUNT_MERGE : ITEM_COUNT_NOT_MERGE) - << " items per line, but found " << itemList.size() << " items." << std::endl - << "Please check the file format and content for correctness." << std::endl; + std::cerr << "Failed to parse line " << line << " of the input file: '" << + input << "'." << std::endl << + "Expected " << (compilerOptions_.mergeAbc ? ITEM_COUNT_MERGE : ITEM_COUNT_NOT_MERGE) << + " items per line, but found " << itemList.size() << " items." << std::endl << + "Please check the file format and content for correctness." << std::endl; return false; } @@ -169,9 +170,9 @@ void Options::ParseCacheFileOption(const std::string &cacheInput) std::string line; ifs.open(panda::os::file::File::GetExtendedFilePath(cacheInput.substr(1))); if (!ifs.is_open()) { - std::cerr << "Failed to open cache file list from the provided path: '" << cacheInput << "'." << std::endl - << "Please check if the file exists or the path is correct, " - << "and you have the necessary permissions to read the file." << std::endl; + std::cerr << "Failed to open cache file list from the provided path: '" << cacheInput << "'." << std::endl << + "Please check if the file exists or the path is correct, " << + "and you have the necessary permissions to read the file." << std::endl; return; } @@ -406,9 +407,9 @@ bool Options::Parse(int argc, const char **argv) // common mode auto inputAbs = panda::os::file::File::GetAbsolutePath(sourceFile_); if (!inputAbs) { - std::cerr << "Failed to find file '" << sourceFile_ << "' during input file resolution" << std::endl - << "Please check if the file name is correct, the file exists at the specified path, " - << "and your project has the necessary permissions to access it." << std::endl; + std::cerr << "Failed to find file '" << sourceFile_ << "' during input file resolution" << std::endl << + "Please check if the file name is correct, the file exists at the specified path, " << + "and your project has the necessary permissions to access it." << std::endl; return false; } diff --git a/es2panda/util/helpers.cpp b/es2panda/util/helpers.cpp index caa411d9fe2f5253f596fca7adf7815218e4123d..0946e7a9915ac2fd689ce052e87a1447932cfa0e 100644 --- a/es2panda/util/helpers.cpp +++ b/es2panda/util/helpers.cpp @@ -162,15 +162,15 @@ void Helpers::GetScientificNotationForDouble(double number, uint32_t significand char *significandArray, char *sciNotationArray, uint32_t size) { if (size < MAX_DOUBLE_DIGIT) { - std::cerr << "Failed to set the size of buffer, the buffer size provided (" << size - << ") is less than the required minimum size (" << MAX_DOUBLE_DIGIT - << ") for formatting the number in scientific notation." << std::endl; + std::cerr << "Failed to set the size of buffer, the buffer size provided (" << size << + ") is less than the required minimum size (" << MAX_DOUBLE_DIGIT << + ") for formatting the number in scientific notation." << std::endl; return; } if (snprintf_s(sciNotationArray, size, size - 1, "%.*e", significandBitCount - 1, number) == FAIL_SNPRINTF_S) { - std::cerr << "Failed to format the number " << number - << " into scientific notation using snprintf_s. Please check if the buffer size (" << size - << ") and significand bit count (" << significandBitCount << ") are appropriate." << std::endl; + std::cerr << "Failed to format the number " << number << + " into scientific notation using snprintf_s. Please check if the buffer size (" << size << + ") and significand bit count (" << significandBitCount << ") are appropriate." << std::endl; return; } diff --git a/es2panda/util/symbolTable.cpp b/es2panda/util/symbolTable.cpp index 4c00281ab0fc52c5edf8097a0e8411d4e9701c65..af01fdf9bcbd23db6f4e526ba2121c4e577bb7ff 100644 --- a/es2panda/util/symbolTable.cpp +++ b/es2panda/util/symbolTable.cpp @@ -27,7 +27,7 @@ const size_t MODULE_ITEM_NUMBER = 1; bool SymbolTable::Initialize() { if (!symbolTable_.empty() && !ReadSymbolTable(symbolTable_)) { - std::cerr << "Failed to open the symbol table file'" << std::endl; + std::cerr << "Failed to open the symbol table file" << std::endl; return false; } @@ -36,10 +36,10 @@ bool SymbolTable::Initialize() fs.open(panda::os::file::File::GetExtendedFilePath(dumpSymbolTable_), std::ios_base::out | std::ios_base::trunc); if (!fs.is_open()) { - std::cerr << "Failed to create or open the output symbol table file '" - << dumpSymbolTable_ << "' during symbol table initialization." << std::endl - << "This error could be due to invalid file path, lack of write permissions, " - << "or the file being in use by another process." << std::endl; + std::cerr << "Failed to create or open the output symbol table file '" << + dumpSymbolTable_ << "' during symbol table initialization." << std::endl << + "This error could be due to invalid file path, lack of write permissions, " << + "or the file being in use by another process." << std::endl; return false; } fs.close(); @@ -74,10 +74,10 @@ bool SymbolTable::ReadSymbolTable(const std::string &symbolTable) std::string line; ifs.open(panda::os::file::File::GetExtendedFilePath(symbolTable)); if (!ifs.is_open()) { - std::cerr << "Failed to open the symbol table file '" - << symbolTable << "' during symbol table reading." << std::endl - << "Please check if the file exists, the path is correct, " - << "and your program has the necessary permissions to access the file." << std::endl; + std::cerr << "Failed to open the symbol table file '" << + symbolTable << "' during symbol table reading." << std::endl << + "Please check if the file exists, the path is correct, " << + "and your program has the necessary permissions to access the file." << std::endl; return false; } @@ -114,9 +114,10 @@ bool SymbolTable::ReadSymbolTable(const std::string &symbolTable) auto moduleItems = GetStringItems(itemList[0], SECOND_LEVEL_SEPERATOR); originModuleInfo_.insert(std::pair(moduleItems[0], moduleItems[1])); } else { - std::cerr << "Failed to read the symbol table line: '" << line - << "' from the symbol table file '" << symbolTable << "' due to unrecognized format." << std::endl - << "Please verify the format of the symbol table." << std::endl; + std::cerr << "Failed to read the symbol table line: '" << line << + "' from the symbol table file '" << symbolTable << + "' due to unrecognized format." << std::endl << + "Please verify the format of the symbol table." << std::endl; } } return true;