From 89948b23c4aca41a5eab6aab4e7baca196da3ecf Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 21 Mar 2023 09:45:57 -0500 Subject: Change parsing to require fewer newlines --- fff.scm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'fff.scm') diff --git a/fff.scm b/fff.scm index 93602a5..686ea87 100755 --- a/fff.scm +++ b/fff.scm @@ -63,17 +63,20 @@ FLAT FUCK FORMAT : Specification (+ array-item))) (define-peg-pattern item all - object-item) + (and object-item + (* NEWLINE))) (define-peg-pattern object-item body (and key (* WHITESPACE) COLON (* WHITESPACE) - (or ref val))) + (or ref val) + (? NEWLINE))) (define-peg-pattern array-item body (and (* WHITESPACE) COLON (* WHITESPACE) - (or ref val))) + (or ref val) + (? NEWLINE))) (define-peg-pattern name all (and key COLON COLON (* WHITESPACE) NEWLINE)) @@ -83,11 +86,10 @@ FLAT FUCK FORMAT : Specification nonl))) (define-peg-pattern val all - (and (* nonl) - NEWLINE)) + (and (* nonl))) (define-peg-pattern ref all - (and AT key NEWLINE)) + (and AT key)) (define-peg-pattern escaped body (and BACKSLASH (or (and NEWLINE (* WHITESPACE)) -- cgit 1.4.1-21-gabe81