Skip to content

Commit a156a59

Browse files
committed
ASR: Introduce BindJS and @ jscall
1 parent 5cb5fdb commit a156a59

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

src/libasr/ASR.asdl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ presence = Required | Optional
147147
-- LPython manages the conversion of arguments to be passed to such symbols
148148
-- and also converts the return values from such symbols.
149149

150+
-- abi=BindJS: the symbol's implementation is
151+
-- available with Javascript.
152+
-- This abi type is to be mainly used with the WASM Backend.
153+
150154
-- abi=Interactive: the symbol's implementation has been provided by the
151155
-- previous REPL execution (e.g., if LLVM backend is used for the interactive
152156
-- mode, the previous execution generated machine code for this symbol's
@@ -164,6 +168,7 @@ abi -- External ABI
164168
| GFortranModule -- Yes GFortran
165169
| BindC -- Yes C
166170
| BindPython -- Yes Python
171+
| BindJS -- Yes Javascript
167172
| Interactive -- Yes Unspecified
168173
| Intrinsic -- Yes Unspecified
169174

src/lpython/semantics/python_ast_to_asr.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4230,6 +4230,8 @@ class SymbolTableVisitor : public CommonVisitor<SymbolTableVisitor> {
42304230
} else if (name == "pythoncall" || name == "pythoncallable") {
42314231
current_procedure_abi_type = ASR::abiType::BindPython;
42324232
current_procedure_interface = (name == "pythoncall");
4233+
} else if (name == "jscall") {
4234+
current_procedure_abi_type = ASR::abiType::BindJS;
42334235
} else if (name == "overload") {
42344236
overload = true;
42354237
} else if (name == "interface") {

0 commit comments

Comments
 (0)