add: whatever I had
This commit is contained in:
Generated
+7
@@ -0,0 +1,7 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "dice-sim"
|
||||
version = "0.1.0"
|
||||
@@ -0,0 +1,6 @@
|
||||
[package]
|
||||
name = "dice-sim"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
@@ -0,0 +1,27 @@
|
||||
// Stores something like 1d6
|
||||
pub struct DiceExpr {
|
||||
count: usize,
|
||||
dice: usize,
|
||||
}
|
||||
|
||||
type Op2 = (Box<Expr>, Box<Expr>);
|
||||
|
||||
type Op1 = DiceExpr;
|
||||
|
||||
type PResult<'a, R> = Result<(R, &'a [char]), String>;
|
||||
|
||||
pub enum Expr {
|
||||
Add(Op2),
|
||||
Sub(Op2),
|
||||
Const(Op1),
|
||||
}
|
||||
|
||||
fn take_while<'a>(expr: &'a [char]) -> PResult<'a, usize> {
|
||||
|
||||
fn take_int<'a>(expr: &'a [char]) -> PResult<'a, usize> {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
pub fn parse<'a>(expr: &'a [char]) -> PResult<'a, Expr> {
|
||||
unimplemented!()
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
}
|
||||
Reference in New Issue
Block a user