This commit is contained in:
Edgar 2023-07-06 12:25:11 +02:00
parent 3d65f04098
commit 6a850d1175
No known key found for this signature in database
GPG key ID: 70ADAE8F35904387
3 changed files with 21 additions and 0 deletions

View file

@ -2,6 +2,13 @@
name = "teeconfig" name = "teeconfig"
version = "0.1.0-alpha.0" version = "0.1.0-alpha.0"
edition = "2021" edition = "2021"
authors = ["Edgar <git@edgarluque.com>"]
description = "A teeworlds/ddnet config parser."
repository = "https://github.com/edg-l/teeconfig/"
license = "AGPL-3.0"
keywords = ["ddnet", "teeworlds", "config", "parser"]
documentation = "https://docs.rs/teeconfig"
readme = "README.md"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

12
README.md Normal file
View file

@ -0,0 +1,12 @@
# teeconfig
A ddnet / teeworlds configuration parser.
It recognizes the available options by parsing source files with `MACRO_CONFIG_` lines such as `src/engine/shared/config_variables.h`.
```rs
let header_source = include_str!("../config_variables.h");
let vars = parse_config_variables(header_source).unwrap();
assert!(!vars.is_empty())
```

View file

@ -1,3 +1,5 @@
#![doc = include_str!("../README.md")]
use bitflags::bitflags; use bitflags::bitflags;
use lalrpop_util::{lalrpop_mod, ParseError}; use lalrpop_util::{lalrpop_mod, ParseError};
use tokens_cpp::{LexicalError, Token}; use tokens_cpp::{LexicalError, Token};