Open stefnotch opened 3 years ago
So, basically, we have this
Document
When we add or move a block, we first figure out the target index. (Binary search over the block positions) Then, we can check if the target index has changed at all. If not, we can instantly return. Then, we take the block above it. If its a normal block, we can just use its scope as our scope If its a scope end block, we jump to the scope start block. And then we use its scope as our scope. Then, we tell the scope about all the variables that we want to 'get' (e.g. 3x+5=) Then, we tell the scope about the 'variables' that we want to provide (e.g. a:=7)
This can trivially be extended to work with nested scopes
Some interesting stuff regarding name resolution and scopes https://github.com/github/stack-graphs https://pl.ewi.tudelft.nl/research/projects/scope-graphs/