parser: use single-quotes in config
[lisp-parkour.git] / parser / scheme / init.lua
blob607a09b6177abce7d5ef644507349455ab5b214d
1 require'lpeg'
2 local lpeg = lpeg
3 local P, S, R = lpeg.P, lpeg.S, lpeg.R
5 -- TODO: add more prefixes
6 local macro_prefix =
7 P'#' * (
8 S'us' * ('8' + '16' + '32' + '64') --[[+ P'f' * ('32' + '64')]] +
9 R'09'^0 * 'vu8' +
10 R'09'^1 +
11 ';') +
12 P'#'^-1 * (P',@' + S",`'") +
13 '#'
15 local opposite = {
16 ['('] = ')',
17 [')'] = '(',
18 ['{'] = '}',
19 ['}'] = '{',
20 ['['] = ']',
21 [']'] = '[',
22 ['"'] = '"',
23 ['|'] = '|',
24 [';'] = '\n',
25 ['\n'] = ';',
26 ['#|'] = '|#',
29 return {
30 prefix = macro_prefix,
31 opposite = opposite,