sml-lang 0.1.0

A fast CFG-style markup/config language parser written in Rust
Documentation
  • Coverage
  • 4.17%
    1 out of 24 items documented0 out of 7 items with examples
  • Size
  • Source code size: 26.5 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 437.22 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 49s Average build duration of successful builds.
  • all releases: 49s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crazysal-0/oxideconf
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • crazysal-0

Sam Markup Language (SML)

SML is a simple, fast markup/config language parser written in Rust.

It tokenizes .sml files, validates syntax, and currently transpiles them into Rust-like structures.


Features

  • Fast single-pass tokenizer
  • Lightweight syntax validation
  • Simple CFG-style parsing model
  • No AST overhead

Syntax

Variables are declared using a name followed by a value separated by whitespace.

sprite_size 32
speed 12.2

Usage

use sml::compile;

fn main() {
    let input = "sprite_size 32\nspeed 12.2";
    
    match sml::compile(input) {
        Ok(output) => println!("{}", output),
        Err(e) => eprintln!("{}", e),
    }
}

Example output:

struct A {
    sprite_size: i64,
    speed: f64,
}

Installation

cargo add sml