Skip to main content

oak_go/formatter/
mod.rs

1//! Go 语言格式化器
2
3use oak_pretty_print::Document;
4
5/// 格式化器 trait
6#[allow(dead_code)]
7pub trait Formatter {
8    /// 格式化给定的 AST
9    fn format(&self, text: &str) -> Document<'_>;
10}
11
12/// Go 语言格式化器
13pub struct GoFormatter;
14
15impl GoFormatter {
16    pub fn new() -> Self {
17        Self
18    }
19}
20
21impl Formatter for GoFormatter {
22    fn format(&self, _text: &str) -> Document<'_> {
23        Document::Nil
24    }
25}