Skip to main content

oak_dockerfile/language/
mod.rs

1use oak_core::{Language, LanguageCategory};
2
3/// Dockerfile 语言配置
4#[derive(Debug, Clone, Copy)]
5pub struct DockerfileLanguage {
6    /// 是否启用严格模式
7    pub strict_mode: bool,
8    /// 是否允许多阶段构
9    pub multi_stage: bool,
10}
11
12impl Default for DockerfileLanguage {
13    fn default() -> Self {
14        Self { strict_mode: false, multi_stage: true }
15    }
16}
17
18impl Language for DockerfileLanguage {
19    const NAME: &'static str = "dockerfile";
20    const CATEGORY: LanguageCategory = LanguageCategory::Programming;
21
22    type TokenType = crate::kind::DockerfileSyntaxKind;
23    type ElementType = crate::kind::DockerfileSyntaxKind;
24    type TypedRoot = ();
25}