Skip to content

rozbb/nom-lua53

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.

nom-lua53

A toy parser for Lua 5.3 written using nom

Usage

extern crate nom_lua53;
use std::io::{self, Read};
use nom_lua53::{parse_all, ParseResult};

fn main() {
    let mut input = Vec::new();
    io::stdin().read_to_end(&mut input).expect("couldn't read from stdin");
    match parse_all(&*input) {
        ParseResult::Done(ss) => {
            println!("Done. statements == {:#?}", ss);
        }
        ParseResult::Error(rest, ss) => {
            println!("Error. statements == {:#?}", ss);
            println!("rest == '{}'", String::from_utf8_lossy(rest));
        }
    }
}

About

A parser for Lua 5.3 written using the nom parser combinator library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages