Skip to content
Merged
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
5 changes: 5 additions & 0 deletions src/lpython/semantics/python_ast_to_asr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,11 @@ class CommonVisitor : public AST::BaseVisitor<Struct> {
return nullptr;
}


void visit_AsyncFunctionDef(const AST::AsyncFunctionDef_t &x){
throw SemanticError("The `async` keyword is currently not supported", x.base.base.loc);
}

void visit_expr_list(AST::expr_t** exprs, size_t n,
Vec<ASR::expr_t*>& exprs_vec) {
LCOMPILERS_ASSERT(exprs_vec.reserve_called);
Expand Down
4 changes: 4 additions & 0 deletions tests/errors/test_async.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
async def test_async():
print("done")

test_async()
13 changes: 13 additions & 0 deletions tests/reference/asr-test_async-361297c.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"basename": "asr-test_async-361297c",
"cmd": "lpython --show-asr --no-color {infile} -o {outfile}",
"infile": "tests/errors/test_async.py",
"infile_hash": "f4d737246effd50f1798a81f07042ad15a045e275448fe0226334f03",
"outfile": null,
"outfile_hash": null,
"stdout": null,
"stdout_hash": null,
"stderr": "asr-test_async-361297c.stderr",
"stderr_hash": "abf614594f89a7a6d93d469d512e31de5adc64feef866957de80cd03",
"returncode": 2
}
9 changes: 9 additions & 0 deletions tests/reference/asr-test_async-361297c.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
semantic error: The `async` keyword is currently not supported
--> tests/errors/test_async.py:1:1 - 2:17
|
1 | async def test_async():
| ^^^^^^^^^^^^^^^^^^^^^^^...
...
|
2 | print("done")
| ...^^^^^^^^^^^^^^^^^
4 changes: 4 additions & 0 deletions tests/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,10 @@ ast_new = true

# tests/errors

[[test]]
filename = "errors/test_async.py"
asr = true

[[test]]
filename = "errors/test_str_indexing.py"
asr = true
Expand Down