Skip to content

Commit e39f04f

Browse files
authored
Merge pull request #2246 from Shaikh-Ubaid/shorter_names
Shorter names for global_initializer() and global_statements()
2 parents 6c72dca + 3054979 commit e39f04f

File tree

209 files changed

+750
-750
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

209 files changed

+750
-750
lines changed

src/lpython/semantics/python_ast_to_asr.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ void get_calls_to_global_init_and_stmts(Allocator &al, const Location &loc, Symb
428428
ASR::Module_t* mod, std::vector<ASR::asr_t *> &tmp_vec) {
429429

430430
std::string mod_name = mod->m_name;
431-
std::string g_func_name = mod_name + "__global_initializer";
431+
std::string g_func_name = mod_name + "global_init";
432432
ASR::symbol_t *g_func = mod->m_symtab->get_symbol(g_func_name);
433433
if (g_func && !scope->get_symbol(g_func_name)) {
434434
ASR::symbol_t *es = ASR::down_cast<ASR::symbol_t>(
@@ -441,7 +441,7 @@ void get_calls_to_global_init_and_stmts(Allocator &al, const Location &loc, Symb
441441
es, g_func, nullptr, 0, nullptr, nullptr, false));
442442
}
443443

444-
g_func_name = mod_name + "__global_statements";
444+
g_func_name = mod_name + "global_stmts";
445445
g_func = mod->m_symtab->get_symbol(g_func_name);
446446
if (g_func && !scope->get_symbol(g_func_name)) {
447447
ASR::symbol_t *es = ASR::down_cast<ASR::symbol_t>(
@@ -4803,7 +4803,7 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
48034803
// `pass_wrap_global_stmts_into_function` pass
48044804
unit->m_items = global_init.p;
48054805
unit->n_items = global_init.size();
4806-
std::string func_name = module_name + "__global_initializer";
4806+
std::string func_name = module_name + "global_init";
48074807
LCompilers::PassOptions pass_options;
48084808
pass_options.run_fun = func_name;
48094809
pass_wrap_global_stmts(al, *unit, pass_options);
@@ -4826,7 +4826,7 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
48264826
if (items.n > 0) {
48274827
unit->m_items = items.p;
48284828
unit->n_items = items.size();
4829-
std::string func_name = module_name + "__global_statements";
4829+
std::string func_name = module_name + "global_stmts";
48304830
// Wrap all the global statements into a Function
48314831
LCompilers::PassOptions pass_options;
48324832
pass_options.run_fun = func_name;

tests/reference/asr-array_01_decl-39cf894.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "asr-array_01_decl-39cf894.stdout",
9-
"stdout_hash": "150d5c201e389b6a146b7c7779048379519336a4f035fd7c4bc74a3f",
9+
"stdout_hash": "b45d33de49ca7e90f8327f100d88a858c8449acf8d8fa2bc527b346f",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/asr-array_01_decl-39cf894.stdout

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@
5555
(Integer 4)
5656
()
5757
),
58-
__main____global_statements:
58+
__main__global_stmts:
5959
(Function
6060
(SymbolTable
6161
207
6262
{
6363

6464
})
65-
__main____global_statements
65+
__main__global_stmts
6666
(FunctionType
6767
[]
6868
()
@@ -918,22 +918,22 @@
918918
(SymbolTable
919919
208
920920
{
921-
__main____global_statements:
921+
__main__global_stmts:
922922
(ExternalSymbol
923923
208
924-
__main____global_statements
925-
2 __main____global_statements
924+
__main__global_stmts
925+
2 __main__global_stmts
926926
__main__
927927
[]
928-
__main____global_statements
928+
__main__global_stmts
929929
Public
930930
)
931931
})
932932
main_program
933933
[__main__]
934934
[(SubroutineCall
935-
208 __main____global_statements
936-
2 __main____global_statements
935+
208 __main__global_stmts
936+
2 __main__global_stmts
937937
[]
938938
()
939939
)]

tests/reference/asr-array_02_decl-e8f6874.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "asr-array_02_decl-e8f6874.stdout",
9-
"stdout_hash": "161c1c315c83399ca9f2f303efe354535ecf820e5529dcddc5b9a059",
9+
"stdout_hash": "40e73d0d895210f7571f8a31ef8d426401f5cb57819271790fb4f7d6",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/asr-array_02_decl-e8f6874.stdout

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
(SymbolTable
88
2
99
{
10-
__main____global_statements:
10+
__main__global_stmts:
1111
(Function
1212
(SymbolTable
1313
205
1414
{
1515

1616
})
17-
__main____global_statements
17+
__main__global_stmts
1818
(FunctionType
1919
[]
2020
()
@@ -704,22 +704,22 @@
704704
(SymbolTable
705705
206
706706
{
707-
__main____global_statements:
707+
__main__global_stmts:
708708
(ExternalSymbol
709709
206
710-
__main____global_statements
711-
2 __main____global_statements
710+
__main__global_stmts
711+
2 __main__global_stmts
712712
__main__
713713
[]
714-
__main____global_statements
714+
__main__global_stmts
715715
Public
716716
)
717717
})
718718
main_program
719719
[__main__]
720720
[(SubroutineCall
721-
206 __main____global_statements
722-
2 __main____global_statements
721+
206 __main__global_stmts
722+
2 __main__global_stmts
723723
[]
724724
()
725725
)]

tests/reference/asr-bindc_01-6d521a9.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "asr-bindc_01-6d521a9.stdout",
9-
"stdout_hash": "6d5d14fd8d94205b92c250418a6b8f8db22282bd6d5f9d10677ef660",
9+
"stdout_hash": "ec7543eae1d1bbaeba72993e35e98165ba0248ab59dc6597f9c50e7b",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/asr-bindc_01-6d521a9.stdout

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
(SymbolTable
88
2
99
{
10-
__main____global_statements:
10+
__main__global_stmts:
1111
(Function
1212
(SymbolTable
1313
4
1414
{
1515

1616
})
17-
__main____global_statements
17+
__main__global_stmts
1818
(FunctionType
1919
[]
2020
()
@@ -185,22 +185,22 @@
185185
(SymbolTable
186186
5
187187
{
188-
__main____global_statements:
188+
__main__global_stmts:
189189
(ExternalSymbol
190190
5
191-
__main____global_statements
192-
2 __main____global_statements
191+
__main__global_stmts
192+
2 __main__global_stmts
193193
__main__
194194
[]
195-
__main____global_statements
195+
__main__global_stmts
196196
Public
197197
)
198198
})
199199
main_program
200200
[__main__]
201201
[(SubroutineCall
202-
5 __main____global_statements
203-
2 __main____global_statements
202+
5 __main__global_stmts
203+
2 __main__global_stmts
204204
[]
205205
()
206206
)]

tests/reference/asr-bindc_02-bc1a7ea.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "asr-bindc_02-bc1a7ea.stdout",
9-
"stdout_hash": "85f0714bd83ac6e159ac5495baa2359741e49e63b8ac049093b27f42",
9+
"stdout_hash": "e7c1aac9ae8d0cc269135f3d79b99fbda0574b09d8d7d20bced754ec",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/asr-bindc_02-bc1a7ea.stdout

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
(SymbolTable
88
2
99
{
10-
__main____global_statements:
10+
__main__global_stmts:
1111
(Function
1212
(SymbolTable
1313
201
1414
{
1515

1616
})
17-
__main____global_statements
17+
__main__global_stmts
1818
(FunctionType
1919
[]
2020
()
@@ -396,22 +396,22 @@
396396
(SymbolTable
397397
202
398398
{
399-
__main____global_statements:
399+
__main__global_stmts:
400400
(ExternalSymbol
401401
202
402-
__main____global_statements
403-
2 __main____global_statements
402+
__main__global_stmts
403+
2 __main__global_stmts
404404
__main__
405405
[]
406-
__main____global_statements
406+
__main__global_stmts
407407
Public
408408
)
409409
})
410410
main_program
411411
[__main__]
412412
[(SubroutineCall
413-
202 __main____global_statements
414-
2 __main____global_statements
413+
202 __main__global_stmts
414+
2 __main__global_stmts
415415
[]
416416
()
417417
)]

tests/reference/asr-callback_01-df40fd5.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "asr-callback_01-df40fd5.stdout",
9-
"stdout_hash": "6d2cb98041fd7ca591cdd1d108b8e33cf28596ae877e7483040b53f3",
9+
"stdout_hash": "5be73c5b09034604701853c55fffbdca38993aa3f92782e89a50c91e",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

0 commit comments

Comments
 (0)