drym-org / symex.el

An intuitive way to edit Lisp symbolic expressions ("symexes") structurally in Emacs
Other
272 stars 23 forks source link

Tree-sitter: Splice / Raise (?) #80

Open countvajhula opened 1 year ago

countvajhula commented 1 year ago

What do splice and raise mean in the context of non-Lisp languages?

E.g. in Lisp, we can introduce hierarchy levels simply by using parentheses, whereas in other languages, hierarchy levels are typically implied by the use of specific named syntax like for and class. So, it would seem that "splicing" an expression should remove the outer syntax (e.g. for x in data:) and promote the contents to the containing level -- that is, it's not just a matter of removing parentheses but also removing the wrapping syntax that implies the hierarchy level. Is this straightforward to do using tree-edit APIs?

If it isn't straightforward, then this feature is probably best left for later.

Raise might be easier to implement, and if that's the case, we could narrow the scope of this ticket to just raise (comment on the integration branch PR or directly edit this ticket if you have an opinion on this).