From 34f2436999c67662f8cdd8de58f0f961bea05ac9 Mon Sep 17 00:00:00 2001 From: Dane Johnson Date: Mon, 24 Jan 2022 13:57:22 -0600 Subject: [PATCH] Update PEG --- spec.txt | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/spec.txt b/spec.txt index c2c787c..f1041d9 100644 --- a/spec.txt +++ b/spec.txt @@ -17,9 +17,11 @@ Requirements: 3. Both story-writing and story-interaction tools need to be cross platform and relatively straightforwards for a non technical user to operate. -Story language PEG: (with apologies, this is my first PEG) +Story language PEG: -Story <- BlankLine* Page+ EndOfFile +Story <- BlankLine* Title Attribution Page+ EndOfFile +Title <- (!Attribution .)+ +Attribution <- (!Newline .)+ Newline Page <- Header Body BlankLine* Header <- Identifier Newline BlankLine* Identifier <- [A-Z][A-Z0-9_]* @@ -38,18 +40,6 @@ BlankLine <- Spacing Newline Spacing <- (' ' / '\t')* Newline <- '\r\n' / '\r' / '\n' -Story language CFG: - -story : pages <> -pages : pages page | <> -page : ID FREETEXT footer -footer : "THE END" | "GOTO" ID | choices -choices : choices choice | choice -choice : INT ')' FREETEXT maybe-skillcheck redirect maybe-skillchange -redirect : '[' ID ']' -maybe-skillcheck : '<' SKILL INT op '>' | <> -maybe-skillchange: '(' op INT SKILL ') | <> - Work log: 12/13/21