internal: move ws attachment logic to the parser crate

This has to re-introduce the `sink` pattern, because doing this purely
with iterators is awkward :( Maaaybe the event vector was a false start?

But, anyway, I like the current factoring more -- it sort-of obvious
that we do want to keep ws-attachment business in the parser, and that
we also don't want that to depend on the particular tree structure. I
think `shortcuts` module achieves that.
This commit is contained in:
Aleksey Kladov 2021-12-26 16:47:10 +03:00
parent c456b217d8
commit f4cb0ff9be
6 changed files with 255 additions and 221 deletions

View file

@ -10,7 +10,7 @@ use parser::Reparser;
use text_edit::Indel;
use crate::{
parsing::text_tree_sink::build_tree,
parsing::build_tree,
syntax_node::{GreenNode, GreenToken, NodeOrToken, SyntaxElement, SyntaxNode},
SyntaxError,
SyntaxKind::*,