9 ms·
Languages where blocks are indicated by indentation are not context-free (you have to keep the current and previous line indentation level as state). Everything
by sedachv 4y ago
Languages where blocks are indicated by indentation are not context-free (you have to keep the current and previous line indentation level as state). Everything about them is more tedious because you can't do structured editing.
- taeric 4y agoApologies if I was unclear, but this is what I meant. In whitespace languages, you have to see the context. That said, you can probably make dinner structural editing work roughly the same. Might benefit from highlighting to indicate current scope.
- ArneBab 4y agoDo you mean highlighting like this? https://www.draketo.de/software/wisp-mode-highlighting-semantic-background-color-interactive-current-line.ogv https://www.draketo.de/software/wisp-mode-highlighting-seman... Many parts of structural editing (but not all) become simple indentation shifting with indentation-sensitive languages.
- taeric 4y agoI think so, yes. And I know many become an indentation shift. This can be a lot more intrusive then just moving a paren. I personally find it harder to match indentation shifts. (Excepting simple one liners, of course.)
- ArneBab 4y agoI usually do the alignment with tab: my Emacs wisp-mode knows the indentation levels in use in the file, so it’s just shift-tab to go back to the previous scope and tab to nest more deeply. One observation I made is that wrapping an expression around several lines is often less intrusive, because I can simply insert a line before the block that uses only half the indentation.
- User23 4y agoYou color them with virtual parentheses and then handle everything else sanely. Parinfer is a good example of how that logic looks.