#import "expression.typ" : node,expression
#let oldnode = node
#let oldexpr = expression
#let state = state("expr",("type":"exprstate"))
#let node(x,data) = {
state.update(
i => {
i.insert(x,oldnode(x,data))
i
}
)
[node #x]
[#oldnode(x,data)]
}
#let expression(x,..y) = {
[<l>]
oldexpr(x,..y, nodes : state.at(?????????) )
}
#node("a",40)
#node("b",50)
#expression(
":a^2 * :a^2",
digit : 0,
)
#How to get a location of where a function is called while inside the function.
11 messages · Page 1 of 1 (latest)
I'm not completely sure what you mean, but can't you use locate for that?
In this case you might want something like
locate(loc => state.at(loc))
Oh thank you !
?render
#let state = state("expr",("type":"exprstate"))
#let x = locate(loc => state.at(loc))
#type(x)