[obsidian] vault backup: 2025-07-31 19:25:07[
Some checks failed
Build / build (push) Failing after 14m32s

This commit is contained in:
2025-07-31 19:25:07 +09:00
parent b32ef1d348
commit 3d7c9c9048

View File

@@ -17,3 +17,25 @@ AST→フォーマッタ用の専用の木構造みたいな中間表現を一
[[Tree-sitter]]を使った汎用フォーマッター[Topiary](https://topiary.tweag.io/)とかいうのもある
---
Exprの途中に差し込まれたトリビア主にコメントをどうやって抽出するか
ExprNodeIdに対するSecondary MapがSpanに対して作れているのだから、Trailng Triviaとしてコメントを保持するのは一応できるか
パーサコンビネータでどうにか処理できるもんか?
```rust
fn parse_expr_top<Output>()->impl Parser<Token,Output,Error>{
not(comment()).padded_by(comment().repeated())
}
```
[Parser in chumsky - Rust](https://docs.rs/chumsky/latest/chumsky/trait.Parser.html#method.map_with)
`map_with`使えばいけるかしら
Stateにトリビアを書き込んでおけばいいのか