fix floating-point vectors prefixes
[lisp-parkour.git] / parser / scheme / init.lua
bloba6bc05fbeaf7bcfef31879b9d05036fd7c450954
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' * (P'8' + '16' + '32' + '64') + P'f' * (P'32' + '64') +
9 R'09'^0 * 'vu8' +
10 R'09'^1 +
11 ';') +
12 P'#'^-1 * (P',@' + S",`'") +
13 '#'
15 -- XXX: weak_prefix can be added for some Schemes
17 local delimiters = {
18 ['('] = ')',
19 ['{'] = '}',
20 ['['] = ']',
21 ['"'] = '"',
22 ['|'] = '|',
23 [';'] = '\n',
24 ['#|'] = '|#',
27 return {
28 prefix = macro_prefix,
29 opposite = delimiters,