fez-lisp 1.6.91 → 1.6.93

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "fez-lisp",
3
3
  "description": "Lisp interpreted & compiled to JavaScript",
4
4
  "author": "AT290690",
5
- "version": "1.6.91",
5
+ "version": "1.6.93",
6
6
  "type": "module",
7
7
  "main": "index.js",
8
8
  "keywords": [
@@ -25,7 +25,7 @@
25
25
  "build": "node ./lib/builder.js",
26
26
  "fez": "node main.js",
27
27
  "test": "mocha",
28
- "examples": "node ./examples/leetcode/test.spec.js && node ./examples/2015/test.spec.js && node ./examples/2018/test.spec.js && node ./examples/2019/test.spec.js && node ./examples/2020/test.spec.js && node ./examples/2021/test.spec.js && node ./examples/2023/test.spec.js && node ./examples/2024/test.spec.js"
28
+ "examples": "node ./examples/leetcode/test.spec.js && node ./examples/quests/test.spec.js && node ./examples/2015/test.spec.js && node ./examples/2018/test.spec.js && node ./examples/2019/test.spec.js && node ./examples/2020/test.spec.js && node ./examples/2021/test.spec.js && node ./examples/2023/test.spec.js && node ./examples/2024/test.spec.js"
29
29
  },
30
30
  "license": "MIT",
31
31
  "devDependencies": {
package/src/check.js CHANGED
@@ -2140,6 +2140,13 @@ export const typeCheck = (
2140
2140
  const name = rest[i][0][VALUE]
2141
2141
  if (!env[name]) continue
2142
2142
  else if (name === KEYWORDS.IF) {
2143
+ // TODO: optimize this!!!
2144
+ // it will be extremely slow if
2145
+ // the condition is
2146
+ // 1. deeply nested
2147
+ // 2. piped with other things
2148
+ // as it will type check everything
2149
+ // for each condition exponentially
2143
2150
  const concequent = [...rest]
2144
2151
  const alternative = [...rest]
2145
2152
  concequent[i] = rest[i][2]
package/src/keywords.js CHANGED
@@ -116,5 +116,8 @@ export const GETTERS_SET = new Set([
116
116
  KEYWORDS.GET_ARRAY,
117
117
  'array:get-number',
118
118
  'array:get-array',
119
- 'array:get-boolean'
119
+ 'array:get-boolean',
120
+ 'pop!',
121
+ 'array:pop!',
122
+ 'array:at'
120
123
  ])
package/src/macros.js CHANGED
@@ -49,7 +49,7 @@ export const SUGGAR = {
49
49
  BOOLEAN_VARIABLE: 'boolean',
50
50
  BOOLEAN_VARIABLE_GET: 'boole',
51
51
  BOOLEAN_VARIABLE_SET: 'boole-set',
52
- GET_ARRAY: 'array:get'
52
+ GET_ARRAY: 'get'
53
53
  }
54
54
  export const deSuggarAst = (ast, scope) => {
55
55
  if (scope === undefined) scope = ast
package/src/types.js CHANGED
@@ -46,7 +46,8 @@ export const GET_ARRAY_INFERENCE_SET = new Set([
46
46
  'array:first',
47
47
  'array:second',
48
48
  'array:third',
49
- 'array:last'
49
+ 'array:last',
50
+ 'array:pop!'
50
51
  ])
51
52
  export class SubType {
52
53
  constructor(args) {