From 83688b5246eafbdeaa7c6739c1b3f5f536f2762e Mon Sep 17 00:00:00 2001 From: mitchellhansen Date: Mon, 26 Oct 2020 23:16:17 -0700 Subject: [PATCH] parser work --- notes/layout-scripts.txt | 3 ++- resources/scripts/scratch | 9 +++++++++ src/parser/parser.rs | 9 ++++++--- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/notes/layout-scripts.txt b/notes/layout-scripts.txt index dfd38bb4..77a6e987 100644 --- a/notes/layout-scripts.txt +++ b/notes/layout-scripts.txt @@ -20,7 +20,8 @@ elem table : globalTableFormatting { } } -meta globalTableFormatting : { +meta globalTableFormatting { + } **meta is a keyword specifying that the next token will contain some subset of the data that an elem that needs to render.** diff --git a/resources/scripts/scratch b/resources/scripts/scratch index 2e2aad07..b3966381 100644 --- a/resources/scripts/scratch +++ b/resources/scripts/scratch @@ -5,3 +5,12 @@ elem table { } } +elem table { + elem tr { + + } + elem tr { + + } +} + diff --git a/src/parser/parser.rs b/src/parser/parser.rs index f7c7f69c..03cf1360 100644 --- a/src/parser/parser.rs +++ b/src/parser/parser.rs @@ -36,6 +36,12 @@ pub enum ElementGraph { } +pub struct ElemBuilder(); + +impl ElemBuilder { + +} + // ENTRY pub fn parse_script<'a, E: ParseError<&'a str>>(input: &'a str) -> IResult<&'a str, ScriptMeta, E> { println!("Full input string : {:?}\n", input); @@ -60,9 +66,6 @@ pub fn parse_script<'a, E: ParseError<&'a str>>(input: &'a str) -> IResult<&'a s )(remaining_str); - - - remaining_str = match_type.unwrap().0; }