diff options
Diffstat (limited to 'fff.scm')
-rwxr-xr-x[-rw-r--r--] | fff.scm | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/fff.scm b/fff.scm index 6e524ad..e4409e8 100644..100755 --- a/fff.scm +++ b/fff.scm | |||
@@ -1,5 +1,43 @@ | |||
1 | (use-modules (ice-9 peg) | 1 | #!/bin/sh |
2 | (ice-9 match)) | 2 | #| -*- scheme -*- |
3 | exec guile -e main -s "$0" "$@" | ||
4 | |||
5 | Flat Fuck Format | ||
6 | --- a new configuration format, because who doesn't need that? | ||
7 | |||
8 | Copyright (C) 2023 Case Duckworth <acdw@acdw.net> | ||
9 | |||
10 | Everyone is permitted to do whatever with this software, without | ||
11 | limitation. This software comes without any warranty whatsoever, | ||
12 | but with two pieces of advice: | ||
13 | |||
14 | - Don't hurt yourself. | ||
15 | - Make good choices. | ||
16 | |||
17 | Commentary: | ||
18 | |||
19 | This script will convert files defined in the Flat Fuck Format (fff) into json. | ||
20 | It will not convert anything back to fff. fff is explicitly made to be as | ||
21 | simple as possible, and exclusively human-written. If a machine writes your | ||
22 | configuration, ... use a better configuration format. Or make your program | ||
23 | scriptable! | ||
24 | |||
25 | FLAT FUCK FORMAT : Specification | ||
26 | |# | ||
27 | !# | ||
28 | |||
29 | (define-module (fff) | ||
30 | #:use-module (ice-9 peg) | ||
31 | #:use-module (ice-9 match) | ||
32 | #:use-module (srfi srfi-11) | ||
33 | #:version (0 1 0) | ||
34 | #:export (fff | ||
35 | fff? | ||
36 | fff/comments? | ||
37 | fff->scm)) | ||
38 | |||
39 | |||
40 | ;;; PEG Grammar | ||
3 | 41 | ||
4 | (define-peg-pattern fff all | 42 | (define-peg-pattern fff all |
5 | (and (* (or WHITESPACE NEWLINE)) | 43 | (and (* (or WHITESPACE NEWLINE)) |