@@ -2294,39 +2294,6 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
2294
2294
throw SemanticError (call_name + " () must have one integer argument" ,
2295
2295
x.base .base .loc );
2296
2296
}
2297
- } else if (call_name == " bool" ) {
2298
- if (args.size () != 1 ) {
2299
- throw SemanticError (call_name + " () takes exactly one argument (" +
2300
- std::to_string (args.size ()) + " given)" , x.base .base .loc );
2301
- }
2302
- ASR::ttype_t *type = ASRUtils::TYPE (ASR::make_Logical_t (al, x.base .base .loc ,
2303
- 1 , nullptr , 0 ));
2304
- ASR::expr_t * arg = ASRUtils::expr_value (args[0 ]);
2305
- ASR::ttype_t * t = ASRUtils::expr_type (arg);
2306
- bool result;
2307
- if (ASRUtils::is_real (*t)) {
2308
- double rv = ASR::down_cast<ASR::ConstantReal_t>(arg)->m_r ;
2309
- result = rv ? true : false ;
2310
- } else if (ASRUtils::is_integer (*t)) {
2311
- int64_t rv = ASR::down_cast<ASR::ConstantInteger_t>(arg)->m_n ;
2312
- result = rv ? true : false ;
2313
- } else if (ASRUtils::is_complex (*t)) {
2314
- double re = ASR::down_cast<ASR::ConstantComplex_t>(arg)->m_re ;
2315
- double im = ASR::down_cast<ASR::ConstantComplex_t>(arg)->m_im ;
2316
- std::complex<double > c (re, im);
2317
- result = (re || im) ? true : false ;
2318
- } else if (ASRUtils::is_logical (*t)) {
2319
- bool rv = ASR::down_cast<ASR::ConstantLogical_t>(arg)->m_value ;
2320
- result = rv;
2321
- } else if (ASRUtils::is_character (*t)) {
2322
- char * c = ASR::down_cast<ASR::ConstantString_t>(ASRUtils::expr_value (arg))->m_s ;
2323
- result = strlen (s2c (al, std::string (c))) ? true : false ;
2324
- } else {
2325
- throw SemanticError (call_name + " () must have one real, integer, character,"
2326
- " complex, or logical argument" , x.base .base .loc );
2327
- }
2328
- tmp = ASR::make_ConstantLogical_t (al, x.base .base .loc , result, type);
2329
- return ;
2330
2297
} else if (call_name == " callable" ) {
2331
2298
if (args.size () != 1 ) {
2332
2299
throw SemanticError (call_name + " () takes exactly one argument (" +
0 commit comments