GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - corn-config/corn.zig: Corn parser implemented in Zig

BranchesTags
Open more actions menu

Latest commit

 

History

8 Commits
8 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.zig
build.zig
 
 
build.zig.zon
build.zig.zon
 
 

Repository files navigation

Corn.zig

Implementation of the Corn configuration language in the Zig programming language.

Work in progress

This library is currently a work-in-progress and isn't fully ready to be used.

Installation

To the .dependencies section of your build.zig.zon file, add:

.corn = {
  .url = "https://github.com/corn-config/corn.zig/archive/refs/tags/v0.0.1.tar.gz",
  .hash = "corn-0.0.1-K8bW1DfuAABspuvfDhXCTSpINnoY27nKGfUe1hGoS9dn", 
}

then to your build.zig file you can add:

// This assumes you have a fairly-standard build configuration!

const corn = b.dependency("corn", .{
  .target = target,
  .optimize = optimize,
});

exe.addModule("corn", corn.module("corn"));

Usage

const std = @import("std");
const corn = @import("corn");

const assert = std.debug.assert;
const eql = std.mem.eql;

const Cat = struct {
    color: []const u8,
    purring: bool,
};

fn main() !void {
    var gpa: std.heap.GeneralPurposeAllocator(.{}) = .init;
    const allocator = gpa.allocator();
    const input = "{ color = \"orange\" purring = true }";

    const cat = try corn.parseCorn(Cat, input, allocator, null);

    assert(eql(u8, cat.color, "orange"));
    assert(cat.purring);
}  

About

Corn parser implemented in Zig

Resources

Readme
Apache-2.0 license
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.