oak-smalltalk 0.0.9

High-performance incremental Smalltalk parser for the oak ecosystem with flexible configuration.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#![doc = include_str!("readme.md")]
use crate::language::SmalltalkLanguage;
use oak_core::RedNode;
use oak_pretty_print::{FormatConfig, FormatOutput, FormatResult, Formatter};
/// Smalltalk Code Formatter
pub struct SmalltalkFormatter {
    inner: Formatter<SmalltalkLanguage>,
}

impl SmalltalkFormatter {
    pub fn new(config: FormatConfig) -> Self {
        Self { inner: Formatter::new(config) }
    }

    pub fn format(&mut self, root: &RedNode<SmalltalkLanguage>, source: &str) -> FormatResult<FormatOutput> {
        self.inner.format(root, source)
    }
}