Repository navigation
Closed
Labels
Description
repro:
def match_symbol() -> None:
...passes CPython, but LPython throws:
/Users/brian/CLionProjects/lpython/src/bin/python /Users/brian/CLionProjects/lpython/lasr/LP-pycharm/lasr_lexer.py
Internal Compiler Error: Unhandled exception
Traceback (most recent call last):
File "/Users/brian/CLionProjects/lpython/src/bin/lpython.cpp", line 1844
err = compile_python_to_object_file(arg_file, tmp_o, runtime_library_dir,
File "/Users/brian/CLionProjects/lpython/src/bin/lpython.cpp", line 783
r1 = LCompilers::LPython::python_ast_to_asr(al, lm, *ast, diagnostics, compiler_options,
File "/Users/brian/CLionProjects/lpython/src/lpython/semantics/python_ast_to_asr.cpp", line 7532
auto res2 = body_visitor(al, lm, *ast_m, diagnostics, unit, main_module,
File "/Users/brian/CLionProjects/lpython/src/lpython/semantics/python_ast_to_asr.cpp", line 7485
b.visit_Module(ast);
File "/Users/brian/CLionProjects/lpython/src/lpython/semantics/python_ast_to_asr.cpp", line 4620
visit_stmt(*x.m_body[i]);
File "/Users/brian/CLionProjects/lpython/src/lpython/python_ast.h", line 1883
void visit_stmt(const stmt_t &b) { visit_stmt_t(b, self()); }
File "/Users/brian/CLionProjects/lpython/src/lpython/python_ast.h", line 1751
case stmtType::FunctionDef: { v.visit_FunctionDef((const FunctionDef_t &)x); return; }
File "/Users/brian/CLionProjects/lpython/src/lpython/semantics/python_ast_to_asr.cpp", line 4727
handle_fn(x, *f);
File "/Users/brian/CLionProjects/lpython/src/lpython/semantics/python_ast_to_asr.cpp", line 4709
transform_stmts(body, x.n_body, x.m_body);
File "/Users/brian/CLionProjects/lpython/src/lpython/semantics/python_ast_to_asr.cpp", line 4580
this->visit_stmt(*m_body[i]);
File "/Users/brian/CLionProjects/lpython/src/lpython/python_ast.h", line 1883
void visit_stmt(const stmt_t &b) { visit_stmt_t(b, self()); }
File "/Users/brian/CLionProjects/lpython/src/lpython/python_ast.h", line 1772
case stmtType::Nonlocal: { v.visit_Nonlocal((const Nonlocal_t &)x); return; }
File "/Users/brian/CLionProjects/lpython/src/lpython/semantics/python_ast_to_asr.cpp", line 6441
this->visit_expr(*x.m_value);
File "/Users/brian/CLionProjects/lpython/src/lpython/python_ast.h", line 1910
void visit_expr(const expr_t &b) { visit_expr_t(b, self()); }
File "/Users/brian/CLionProjects/lpython/src/lpython/python_ast.h", line 1807
case exprType::ConstantComplex: { v.visit_ConstantComplex((const ConstantComplex_t &)x); return; }
File "/Users/brian/CLionProjects/lpython/src/lpython/python_ast.h", line 1935
void visit_ConstantEllipsis(const ConstantEllipsis_t & /* x */) { throw LCompilersException("visit_ConstantEllipsis() not implemented"); }
LCompilersException: visit_ConstantEllipsis() not implemented
Activity
rebcabin commentedon Jun 22, 2023
Also consider making
...a synonym forpass, which is, I believe, what CPython does (though I am not 100% sure).faze-geek commentedon Jun 24, 2023
@Thirumalai-Shaktivel I see the grammar for
...is already added here -lpython/src/lpython/parser/semantics.h
Line 998 in 62a217e
A diff like this will do the job here.
Kindly check it out once. I'll make a pr for it then.
certik commentedon Jun 24, 2023
@faze-geek go ahead and make a PR with a test.