fez-lisp 1.5.176 → 1.5.178
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs.html +30 -0
- package/lib/baked/std.js +1 -1
- package/package.json +1 -1
- package/src/macros.js +11 -0
package/package.json
CHANGED
package/src/macros.js
CHANGED
@@ -21,6 +21,7 @@ import { NIL } from './types.js'
|
|
21
21
|
export const SUGGAR = {
|
22
22
|
// Syntactic suggars
|
23
23
|
PIPE: '|>',
|
24
|
+
STR_LIST: '~~',
|
24
25
|
NOT_EQUAL_1: '!=',
|
25
26
|
NOT_EQUAL_2: '<>',
|
26
27
|
REMAINDER_OF_DIVISION_1: '%',
|
@@ -187,6 +188,15 @@ export const deSuggarAst = (ast, scope) => {
|
|
187
188
|
deSuggarAst(exp, scope)
|
188
189
|
}
|
189
190
|
break
|
191
|
+
case SUGGAR.STR_LIST:
|
192
|
+
{
|
193
|
+
const items = rest[0].slice(1)
|
194
|
+
exp.length = 0
|
195
|
+
exp.push([APPLY, SUGGAR.CREATE_LIST])
|
196
|
+
exp.push(...items)
|
197
|
+
deSuggarAst(exp, scope)
|
198
|
+
}
|
199
|
+
break
|
190
200
|
case SUGGAR.CREATE_LIST:
|
191
201
|
{
|
192
202
|
exp.length = 0
|
@@ -688,6 +698,7 @@ export const seeIfProgramIsInvalid = (source) => {
|
|
688
698
|
}
|
689
699
|
export const replaceQuotes = (source) =>
|
690
700
|
source
|
701
|
+
.replaceAll(/\(\(array /g, `(${SUGGAR.STR_LIST} (array `)
|
691
702
|
.replaceAll(/\(\[/g, `(${SUGGAR.CREATE_SET} [`)
|
692
703
|
.replaceAll(/\(\{/g, `(${SUGGAR.CREATE_MAP} [`)
|
693
704
|
.replaceAll(/\[/g, `(${KEYWORDS.CREATE_ARRAY} `)
|