migrate to 12.0
[ta-parkour.git] / parkour / cfg-fennel.lua
blobf21e87506d8d438cc1b5eb54fcf0f7b3b8a14bc8
1 -- SPDX-License-Identifier: GPL-3.0-or-later
2 -- © 2020 Georgi Kirilov
4 local lispwords = {
5 ['do'] = -1,
6 ['eval-compiler'] = -1,
7 ['if'] = -1,
9 ['doto'] = 1,
10 ['each'] = 1,
11 ['fn'] = 1,
12 ['for'] = 1,
13 ['lambda'] = 1,
14 ['let'] = 1,
15 ['match'] = 1,
16 ['when'] = 1,
17 ['while'] = 1,
18 ['with-open'] = 1,
19 ['λ'] = 1,
21 ['macro'] = 2,
24 local squarewords = {
25 not_optional = true,
27 ['each'] = 1,
28 ['for'] = 1,
29 ['let'] = 1,
30 ['with-open'] = 1,
32 ['fn'] = 2,
33 ['lambda'] = 2,
34 ['macro'] = 2,
35 ['λ'] = 2,
38 require'lpeg'
39 local lpeg = lpeg
40 local P, S = lpeg.P, lpeg.S
42 local macro_prefix = S"#,`'"
44 local weak_prefix = P'#'
46 local delimiters = {
47 ['('] = ')',
48 ['{'] = '}',
49 ['['] = ']',
50 ['"'] = '"',
51 [';'] = '\n',
54 return {
55 prefix = macro_prefix,
56 weak_prefix = weak_prefix,
57 opposite = delimiters,
58 lispwords = lispwords,
59 squarewords = squarewords,