[obsidian] vault backup: 2025-07-31 19:25:07[
Some checks failed
Build / build (push) Failing after 14m32s
Some checks failed
Build / build (push) Failing after 14m32s
This commit is contained in:
@@ -17,3 +17,25 @@ AST→フォーマッタ用の専用の木構造みたいな中間表現を一
|
|||||||
|
|
||||||
[[Tree-sitter]]を使った汎用フォーマッター[Topiary](https://topiary.tweag.io/)とかいうのもある
|
[[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にトリビアを書き込んでおけばいいのか
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user