From 4c1ee0a34e7c4936b960d4fbc91677cb4b69f48f Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Wed, 3 Nov 2021 16:27:42 -0700 Subject: [PATCH] Trying out peg --- schala-lang/language/Cargo.toml | 1 + schala-lang/language/src/parsing/mod.rs | 1 + schala-lang/language/src/parsing/new.rs | 8 ++++++++ 3 files changed, 10 insertions(+) create mode 100644 schala-lang/language/src/parsing/new.rs diff --git a/schala-lang/language/Cargo.toml b/schala-lang/language/Cargo.toml index b11b3d1..72e259b 100644 --- a/schala-lang/language/Cargo.toml +++ b/schala-lang/language/Cargo.toml @@ -14,6 +14,7 @@ derivative = "1.0.3" colored = "1.8" radix_trie = "0.1.5" assert_matches = "1.5" +peg = "0.7.0" schala-lang-codegen = { path = "../codegen" } schala-repl = { path = "../../schala-repl" } diff --git a/schala-lang/language/src/parsing/mod.rs b/schala-lang/language/src/parsing/mod.rs index 84f93b5..399a6b2 100644 --- a/schala-lang/language/src/parsing/mod.rs +++ b/schala-lang/language/src/parsing/mod.rs @@ -169,6 +169,7 @@ //! module := 'module' IDENTIFIER '{' statement* '}' //! ``` mod test; +mod new; use std::rc::Rc; diff --git a/schala-lang/language/src/parsing/new.rs b/schala-lang/language/src/parsing/new.rs new file mode 100644 index 0000000..7c68af6 --- /dev/null +++ b/schala-lang/language/src/parsing/new.rs @@ -0,0 +1,8 @@ +use crate::ast::*; + +peg::parser! { + grammar yolo() for str { + rule number() -> + + } +}