Skip to content

Commit

Permalink
necro magic
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-johnson-4 committed Nov 21, 2023
1 parent c38757f commit e8b5800
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/parser_generator.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

use crate::{StringSlice,parse_program};

//Compiled Grammars are just special-case left-hand-sides for term bindings

//Type-0 Grammar Rules
Expand All @@ -15,3 +17,32 @@ enum Symbol {
Descend(String),
}

pub struct ParseResult {
}
impl ParseResult {
pub fn to_string(&self) -> String {
unimplemented!("ParseResult::to_string")
}
}

pub struct Grammar {
}
impl Grammar {
pub fn run(&self, input: &str) -> ParseResult {
unimplemented!("Grammar::run")
}
}

pub fn compile(input: &str) -> Grammar {
let input = StringSlice::new(input.to_string());
let grammar = parse_program(input);
match grammar {
Ok(grammar) => {
for (k,v) in grammar {
println!("{} := {}", k, v);
}
unimplemented!("parser_generator::compile")
},
Err(err) => panic!("{}", err),
}
}
3 changes: 3 additions & 0 deletions tests/b_kwargs.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

/* TODO
use lambda_mountain::Policy;
#[test]
Expand All @@ -14,3 +16,4 @@ fn print_kw0() {
assert_eq!( p.s_hard("f (A 1)"), "1" );
assert_eq!( p.s_hard("g (A 1)"), "()" );
}
*/

0 comments on commit e8b5800

Please sign in to comment.