1 -- SPDX-License-Identifier: GPL-3.0-or-later
2 -- © 2020 Georgi Kirilov
6 local P
, Cc
= lpeg
.P
, lpeg
.Cc
8 local let_likes
= (P
'match-' + 'splicing-')^
-1 * 'let' * (P
'rec' + '*')^
-1 * (P
'-' * (P
'syntax' + 'syntaxes' + 'values'))^
-1 * -P(1)
9 local forfold_likes
= 'for' * P
'*'^
-1 * '/' * (P
'fold' + 'lists')
12 -- If none of the string keys matched, this pattern is attempted
13 [0] = ('define' * ('*' + '-' * P(1)^
1)^
-1 * -P(1) +
14 (P
'call-'^
-1 * 'with-') * P(1)^
1 +
16 forfold_likes
* Cc(2),
22 ['match-lambda'] = -1,
23 ['match-lambda*'] = -1,
25 ['syntax-parser'] = -1,
28 ['compile-time-case'] = 1,
39 ['syntax-parameterize'] = 1,