mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 13:04:30 -08:00
async calls find calls WIP
This commit is contained in:
@@ -630,7 +630,10 @@ export const find_call = (state, index) => {
|
||||
}
|
||||
|
||||
const loc = {index: node.index, module: state.current_module}
|
||||
const {calltree, call} = state.calltree_actions.find_call(loc)
|
||||
const {calltree, call} = state.calltree_actions.find_call(
|
||||
loc,
|
||||
get_async_calls(state)
|
||||
)
|
||||
if(call == null) {
|
||||
return add_calltree_node_by_loc(
|
||||
// Remove active_calltree_node
|
||||
|
||||
14
src/eval.js
14
src/eval.js
@@ -310,9 +310,17 @@ export const eval_modules = (
|
||||
}
|
||||
}
|
||||
|
||||
const find_call = (location) => {
|
||||
const find_call = (location, async_calls) => {
|
||||
searched_location = location
|
||||
const {modules, calltree} = run()
|
||||
if(found_call == null && async_calls != null) {
|
||||
for(let c of async_calls) {
|
||||
c.fn.apply(c.context, c.args)
|
||||
if(found_call != null) {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
searched_location = null
|
||||
const call = found_call
|
||||
found_call = null
|
||||
@@ -554,8 +562,8 @@ export const eval_modules = (
|
||||
const expanded = actions.expand_calltree_node(node)
|
||||
return assign_code(parse_result.modules, expanded)
|
||||
},
|
||||
find_call: (loc) => {
|
||||
const {modules, calltree, call} = actions.find_call(loc)
|
||||
find_call: (loc, async_calls) => {
|
||||
const {modules, calltree, call} = actions.find_call(loc, async_calls)
|
||||
return {
|
||||
calltree: assign_code(parse_result.modules, calltree),
|
||||
// TODO: `call` does not have `code` property here. Currently it is
|
||||
|
||||
Reference in New Issue
Block a user