cumin

Crates.iocumin
lib.rscumin
version0.9.13
sourcesrc
created_at2021-02-12 09:24:23.681639
updated_at2021-07-03 14:58:08.616277
descriptionCumin, Configuration Language
homepagehttps://github.com/cympfh/cumin
repository
max_upload_size
id354095
size121,750
/c/ympfh (cympfh)

documentation

README

Cumin

crates.io

Cumin is a Structured, Typed and Mini-Programmable Configuration Language.

Documents

Features

  • Rust-like Syntax
  • Structured
    • struct, enum
  • Typed
    • Validated Data
  • Mini-Programmable

Example

struct UserRecord {
    id: Int,
    name: Option<String> = None,
    region: Region = Region::Unknown,
}

enum Region {
    Unknown,
    East,
    West,
}

[
    UserRecord(1, "cympfh", Region::East),
    UserRecord { id = 2, name = "Alan", region = Region::West, },
    UserRecord { id = 3, name = "Bob" },
    UserRecord { id = 4, region = Region::East },
]

Compiler

Cumin Compiler cuminc converts to JSON from Cumin.

$ cuminc ./examples/names.cumin
[
  {
    "id": 1,
    "name": "cympfh",
    "region": "East"
  },
  {
    "id": 2,
    "name": "Alan",
    "region": "West"
  },
  {
    "id": 3,
    "name": "Bob",
    "region": "Unknown"
  },
  {
    "id": 4,
    "name": null,
    "region": "East"
  }
]

For Vim Users

Plugin 'rust-lang/rust.vim'
au BufRead,BufNewFile *.cumin set filetype=cumin
au FileType cumin set syntax=rust
Commit count: 0

cargo fmt