#parser #data #file-format #format #merge #dent

dent-parse

Dent的扩展表示法解析器

1个不稳定版本

0.1.0 2023年10月12日

#1743解析器实现

MIT 许可证

40KB
956

Dent

Duckonaut的扩展表示法

关于

Dent是一种可扩展的格式,用于存储稍微复杂的数据。

它的基本表示法简单,便于人类使用,但在文件解析时允许执行一些基本操作,例如

  • 将其他.dent文件作为文件的一部分导入,
  • 合并分割的字典或列表。

您可以通过传递给Dent结构的闭包添加许多其他需要的操作。

特性

  • 简单的语法
  • 整数、浮点数、布尔值、字符串
  • 字典
  • 列表
  • 注释
  • 可扩展函数

示例

# file: examples/dent/dict.dent

# Mario
{
    name: Mario
    skills: [
        jumps
        grows
    ]
    age: 35
    alive: true
}

# ...

# another file:

# Define a list of characters
[
    @import "examples/dent/dict.dent"
    {
        name: Link
        skills: [
            swordfighting
            reincarnation
        ]
        age: 23
        alive: true
    }
]

无运行时依赖