Skip to content
Merged

Sync #2854

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 58 additions & 58 deletions integration_tests/CMakeLists.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions integration_tests/test_set_len.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
def test_set():
s: set[i32]
s = {1, 2, 22, 2, -1, 1}
assert len(s2) == 4
s2: set[str]
s2 = {'a', 'b', 'cd', 'b', 'abc', 'a'}
assert len(s2) == 4
Expand Down
2 changes: 1 addition & 1 deletion libasr
Submodule libasr updated 1805 files
40 changes: 20 additions & 20 deletions src/bin/lpython.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ std::string get_kokkos_dir()

int emit_tokens(const std::string &infile, bool line_numbers, const CompilerOptions &compiler_options)
{
std::string input = LCompilers::read_file(infile);
std::string input = LCompilers::read_file_ok(infile);
// Src -> Tokens
Allocator al(64*1024*1024);
std::vector<int> toks;
Expand All @@ -103,7 +103,7 @@ int emit_tokens(const std::string &infile, bool line_numbers, const CompilerOpti
LCompilers::LocationManager::FileLocations fl;
fl.in_filename = infile;
lm.files.push_back(fl);
std::string input = LCompilers::read_file(infile);
std::string input = LCompilers::read_file_ok(infile);
lm.init_simple(input);
lm.file_ends.push_back(input.size());
}
Expand Down Expand Up @@ -140,7 +140,7 @@ int emit_ast(const std::string &infile,
LCompilers::LocationManager::FileLocations fl;
fl.in_filename = infile;
lm.files.push_back(fl);
std::string input = LCompilers::read_file(infile);
std::string input = LCompilers::read_file_ok(infile);
lm.init_simple(input);
lm.file_ends.push_back(input.size());
}
Expand All @@ -161,7 +161,7 @@ int emit_ast(const std::string &infile,
LCompilers::LocationManager::FileLocations fl;
fl.in_filename = infile;
lm.files.push_back(fl);
std::string input = LCompilers::read_file(infile);
std::string input = LCompilers::read_file_ok(infile);
lm.init_simple(input);
lm.file_ends.push_back(input.size());
}
Expand All @@ -172,7 +172,7 @@ int emit_ast(const std::string &infile,
LCompilers::LocationManager::FileLocations fl;
fl.in_filename = infile;
lm.files.push_back(fl);
std::string input = LCompilers::read_file(infile);
std::string input = LCompilers::read_file_ok(infile);
lm.init_simple(input);
lm.file_ends.push_back(input.size());
}
Expand All @@ -197,7 +197,7 @@ int emit_asr(const std::string &infile,
LCompilers::LocationManager::FileLocations fl;
fl.in_filename = infile;
lm.files.push_back(fl);
std::string input = LCompilers::read_file(infile);
std::string input = LCompilers::read_file_ok(infile);
lm.init_simple(input);
lm.file_ends.push_back(input.size());
}
Expand Down Expand Up @@ -250,7 +250,7 @@ int emit_cpp(const std::string &infile,
LCompilers::LocationManager::FileLocations fl;
fl.in_filename = infile;
lm.files.push_back(fl);
std::string input = LCompilers::read_file(infile);
std::string input = LCompilers::read_file_ok(infile);
lm.init_simple(input);
lm.file_ends.push_back(input.size());
}
Expand Down Expand Up @@ -295,7 +295,7 @@ int emit_c(const std::string &infile,
LCompilers::LocationManager::FileLocations fl;
fl.in_filename = infile;
lm.files.push_back(fl);
std::string input = LCompilers::read_file(infile);
std::string input = LCompilers::read_file_ok(infile);
lm.init_simple(input);
lm.file_ends.push_back(input.size());
}
Expand Down Expand Up @@ -347,7 +347,7 @@ int emit_c_to_file(const std::string &infile, const std::string &outfile,
LCompilers::LocationManager::FileLocations fl;
fl.in_filename = infile;
lm.files.push_back(fl);
std::string input = LCompilers::read_file(infile);
std::string input = LCompilers::read_file_ok(infile);
lm.init_simple(input);
lm.file_ends.push_back(input.size());
}
Expand Down Expand Up @@ -401,7 +401,7 @@ int emit_python(const std::string &infile,
LCompilers::LocationManager::FileLocations fl;
fl.in_filename = infile;
lm.files.push_back(fl);
std::string input = LCompilers::read_file(infile);
std::string input = LCompilers::read_file_ok(infile);
lm.init_simple(input);
lm.file_ends.push_back(input.size());
}
Expand Down Expand Up @@ -451,7 +451,7 @@ int emit_wat(const std::string &infile,
LCompilers::LocationManager::FileLocations fl;
fl.in_filename = infile;
lm.files.push_back(fl);
std::string input = LCompilers::read_file(infile);
std::string input = LCompilers::read_file_ok(infile);
lm.init_simple(input);
lm.file_ends.push_back(input.size());
}
Expand Down Expand Up @@ -495,7 +495,7 @@ int emit_wat(const std::string &infile,
int dump_all_passes(const std::string &infile,
const std::string &runtime_library_dir,
CompilerOptions &compiler_options) {
std::string input = LCompilers::read_file(infile);
std::string input = LCompilers::read_file_ok(infile);

Allocator al(4*1024);
LCompilers::LocationManager lm;
Expand Down Expand Up @@ -543,7 +543,7 @@ int get_symbols (const std::string &infile,
LCompilers::LocationManager::FileLocations fl;
fl.in_filename = infile;
lm.files.push_back(fl);
std::string input = LCompilers::read_file(infile);
std::string input = LCompilers::read_file_ok(infile);
lm.init_simple(input);
lm.file_ends.push_back(input.size());
}
Expand Down Expand Up @@ -644,7 +644,7 @@ int get_errors (const std::string &infile,
LCompilers::LocationManager::FileLocations fl;
fl.in_filename = infile;
lm.files.push_back(fl);
std::string input = LCompilers::read_file(infile);
std::string input = LCompilers::read_file_ok(infile);
lm.init_simple(input);
lm.file_ends.push_back(input.size());
}
Expand Down Expand Up @@ -764,7 +764,7 @@ int emit_llvm(const std::string &infile,
LCompilers::LocationManager::FileLocations fl;
fl.in_filename = infile;
lm.files.push_back(fl);
std::string input = LCompilers::read_file(infile);
std::string input = LCompilers::read_file_ok(infile);
lm.init_simple(input);
lm.file_ends.push_back(input.size());
}
Expand Down Expand Up @@ -1057,7 +1057,7 @@ int compile_python_using_llvm(
lm.files.push_back(fl);

auto file_reading_start = std::chrono::high_resolution_clock::now();
std::string input = LCompilers::read_file(infile);
std::string input = LCompilers::read_file_ok(infile);
auto file_reading_end = std::chrono::high_resolution_clock::now();
times.push_back(std::make_pair("File reading", std::chrono::duration
<double, std::milli>(file_reading_end - file_reading_start).count()));
Expand Down Expand Up @@ -1202,7 +1202,7 @@ int compile_to_binary_wasm(
lm.files.push_back(fl);

auto file_reading_start = std::chrono::high_resolution_clock::now();
std::string input = LCompilers::read_file(infile);
std::string input = LCompilers::read_file_ok(infile);
auto file_reading_end = std::chrono::high_resolution_clock::now();
times.push_back(std::make_pair("File reading", std::chrono::duration
<double, std::milli>(file_reading_end - file_reading_start).count()));
Expand Down Expand Up @@ -1275,7 +1275,7 @@ int compile_to_binary_x86(
lm.files.push_back(fl);

auto file_reading_start = std::chrono::high_resolution_clock::now();
std::string input = LCompilers::read_file(infile);
std::string input = LCompilers::read_file_ok(infile);
auto file_reading_end = std::chrono::high_resolution_clock::now();
times.push_back(std::make_pair("File reading", std::chrono::duration
<double, std::milli>(file_reading_end - file_reading_start).count()));
Expand Down Expand Up @@ -1349,7 +1349,7 @@ int compile_to_binary_wasm_to_x86(
lm.files.push_back(fl);

auto file_reading_start = std::chrono::high_resolution_clock::now();
std::string input = LCompilers::read_file(infile);
std::string input = LCompilers::read_file_ok(infile);
auto file_reading_end = std::chrono::high_resolution_clock::now();
times.push_back(std::make_pair("File reading", std::chrono::duration
<double, std::milli>(file_reading_end - file_reading_start).count()));
Expand Down Expand Up @@ -1626,7 +1626,7 @@ int link_executable(const std::vector<std::string> &infiles,

// int emit_c_preprocessor(const std::string &infile, CompilerOptions &compiler_options)
// {
// std::string input = read_file(infile);
// std::string input = read_file_ok(infile);
//
// LFortran::CPreprocessor cpp(compiler_options);
// LFortran::LocationManager lm;
Expand Down
2 changes: 1 addition & 1 deletion src/lpython/parser/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Result<LPython::AST::ast_t*> parse_python_file(Allocator &al,
// We will be using the new parser from now on
new_parser = true;
LCOMPILERS_ASSERT(new_parser)
std::string input = read_file(infile);
std::string input = read_file_ok(infile);
Result<LPython::AST::Module_t*> res = parse(al, input, prev_loc, diagnostics);
if (res.ok) {
ast = (LPython::AST::ast_t*)res.result;
Expand Down
Loading
Loading