8 releases
0.1.11 | Jun 12, 2024 |
---|---|
0.1.10 | Jun 9, 2024 |
#20 in #tokenize
499 downloads per month
Used in specmc-protocol
10KB
215 lines
SpecMC Base
A library with common code for parsing Minecraft specification.
Examples
use specmc_base::{
parse::{Identifier, Literal, Parse},
tokenize::tokenize,
};
let mut tokens: Vec<String> = tokenize("true 42 123.0 \"string\" cool_identifier");
tokens.reverse();
let lit_bool: Literal = Literal::parse(&mut tokens).unwrap();
let lit_int: Literal = Literal::parse(&mut tokens).unwrap();
let lit_float: Literal = Literal::parse(&mut tokens).unwrap();
let lit_str: Literal = Literal::parse(&mut tokens).unwrap();
let ident: Identifier = Identifier::parse(&mut tokens).unwrap();
println!("{lit_bool:?} {lit_int:?} {lit_float:?} {lit_str:?} {ident:?}");
lib.rs
:
A library with common code for parsing Minecraft specification.
Dependencies
~245–700KB
~16K SLoC