@@ -165,7 +165,10 @@ int emit_asr(const std::string &infile,
165
165
return 2 ;
166
166
}
167
167
LFortran::ASR::TranslationUnit_t* asr = r.result ;
168
- pass_manager.apply_passes (al, asr, " f" , true );
168
+ LCompilers::PassOptions pass_options;
169
+ pass_options.run_fun = " f" ;
170
+ pass_options.always_run = true ;
171
+ pass_manager.apply_passes (al, asr, pass_options);
169
172
170
173
if (compiler_options.tree ) {
171
174
std::cout << LFortran::pickle_tree (*asr, compiler_options.use_colors ,
@@ -304,33 +307,33 @@ int get_symbols (const std::string &infile,
304
307
rapidjson::Document end_detail (rapidjson::kObjectType );
305
308
rapidjson::Document location_object (rapidjson::kObjectType );
306
309
rapidjson::Document test_capture (rapidjson::kObjectType );
307
-
310
+
308
311
test_output.SetArray ();
309
-
312
+
310
313
for (auto symbol : symbol_lists) {
311
314
uint32_t start_character = symbol.first_column ;
312
315
uint32_t start_line = symbol.first_line ;
313
316
uint32_t end_character = symbol.last_column ;
314
317
uint32_t end_line = symbol.last_line ;
315
318
std::string name = symbol.symbol_name ;
316
-
319
+
317
320
range_object.SetObject ();
318
321
rapidjson::Document::AllocatorType &allocator = range_object.GetAllocator ();
319
-
322
+
320
323
start_detail.SetObject ();
321
324
start_detail.AddMember (" character" , rapidjson::Value ().SetInt (start_character), allocator);
322
325
start_detail.AddMember (" line" , rapidjson::Value ().SetInt (start_line), allocator);
323
326
range_object.AddMember (" start" , start_detail, allocator);
324
-
327
+
325
328
end_detail.SetObject ();
326
329
end_detail.AddMember (" character" , rapidjson::Value ().SetInt (end_character), allocator);
327
330
end_detail.AddMember (" line" , rapidjson::Value ().SetInt (end_line), allocator);
328
331
range_object.AddMember (" end" , end_detail, allocator);
329
-
332
+
330
333
location_object.SetObject ();
331
334
location_object.AddMember (" range" , range_object, allocator);
332
335
location_object.AddMember (" uri" , rapidjson::Value ().SetString (" uri" , allocator), allocator);
333
-
336
+
334
337
test_capture.SetObject ();
335
338
test_capture.AddMember (" kind" , rapidjson::Value ().SetInt (1 ), allocator);
336
339
test_capture.AddMember (" location" , location_object, allocator);
@@ -342,16 +345,16 @@ int get_symbols (const std::string &infile,
342
345
rapidjson::Writer<rapidjson::StringBuffer> writer (buffer);
343
346
test_output.Accept (writer);
344
347
std::string resp_str ( buffer.GetString () );
345
-
348
+
346
349
std::cout << resp_str;
347
350
}
348
351
else {
349
352
std::cout << " {}\n " ;
350
353
}
351
-
354
+
352
355
return 0 ;
353
356
}
354
-
357
+
355
358
356
359
int get_errors (const std::string &infile,
357
360
const std::string &runtime_library_dir,
@@ -363,7 +366,7 @@ int get_errors (const std::string &infile,
363
366
std::string input = LFortran::read_file (infile);
364
367
lm.init_simple (input);
365
368
LFortran::Result<LFortran::LPython::AST::ast_t *>
366
- r1 = LFortran::parse_python_file (al, runtime_library_dir, infile,
369
+ r1 = LFortran::parse_python_file (al, runtime_library_dir, infile,
367
370
diagnostics, compiler_options.new_parser );
368
371
if (r1.ok ) {
369
372
LFortran::LPython::AST::ast_t * ast = r1.result ;
@@ -396,7 +399,7 @@ int get_errors (const std::string &infile,
396
399
}
397
400
}
398
401
rapidjson::Document range_obj (rapidjson::kObjectType );
399
- rapidjson::Document start_detail (rapidjson::kObjectType );
402
+ rapidjson::Document start_detail (rapidjson::kObjectType );
400
403
rapidjson::Document end_detail (rapidjson::kObjectType );
401
404
rapidjson::Document diag_results (rapidjson::kArrayType );
402
405
rapidjson::Document diag_capture (rapidjson::kObjectType );
@@ -411,7 +414,7 @@ int get_errors (const std::string &infile,
411
414
std::string msg = diag.message ;
412
415
413
416
range_obj.SetObject ();
414
- rapidjson::Document::AllocatorType &allocator = range_obj.GetAllocator ();
417
+ rapidjson::Document::AllocatorType &allocator = range_obj.GetAllocator ();
415
418
416
419
start_detail.SetObject ();
417
420
start_detail.AddMember (" line" , rapidjson::Value ().SetInt (start_line), allocator);
0 commit comments