lichenscript
Advanced tools
+4
-4
| { | ||
| "name": "lichenscript", | ||
| "description": "The compiler of LichenScript", | ||
| "version": "0.5.6", | ||
| "version": "0.6.0", | ||
| "homepage": "https://lichenscript.com/", | ||
@@ -19,6 +19,6 @@ "license": "Apache-2.0", | ||
| "optionalDependencies": { | ||
| "lichenscript-darwin-x64": "0.5.6", | ||
| "lichenscript-linux-x64": "0.5.6", | ||
| "lichenscript-darwin-arm64": "0.5.6" | ||
| "lichenscript-darwin-x64": "0.6.0", | ||
| "lichenscript-linux-x64": "0.6.0", | ||
| "lichenscript-darwin-arm64": "0.6.0" | ||
| } | ||
| } |
+13
-11
@@ -33,11 +33,12 @@ /** | ||
| typedef enum LCObjectType { | ||
| LC_TY_F64 = -9, | ||
| LC_TY_F32 = -8, | ||
| LC_TY_U64 = -7, | ||
| LC_TY_I64 = -6, | ||
| LC_TY_U32 = -5, | ||
| LC_TY_I32 = -4, | ||
| LC_TY_CHAR = -3, | ||
| LC_TY_BOOL = -2, | ||
| LC_TY_UNION = -1, | ||
| LC_TY_F64 = -10, | ||
| LC_TY_F32 = -9, | ||
| LC_TY_U64 = -8, | ||
| LC_TY_I64 = -7, | ||
| LC_TY_U32 = -6, | ||
| LC_TY_I32 = -5, | ||
| LC_TY_CHAR = -4, | ||
| LC_TY_BOOL = -3, | ||
| LC_TY_UNION = -2, | ||
| LC_TY_ATOM = -1, | ||
| LC_TY_NULL = 0, | ||
@@ -463,5 +464,6 @@ LC_TY_UNION_OBJECT = 1, | ||
| #define LC_STD_CLS_ID_RESULT 2 | ||
| #define LC_STD_CLS_ID_MAP 3 | ||
| #define LC_STD_CLS_ID_BUFFER 5 | ||
| #define LC_STD_CLS_ID_ARRAY 3 | ||
| #define LC_STD_CLS_ID_MAP 5 | ||
| #define LC_STD_CLS_ID_BUFFER 7 | ||
| #endif |
@@ -243,2 +243,35 @@ | ||
| const LCC_ArrayIterator = { | ||
| __proto__: LCC_Object, | ||
| [clsNameSym]: "ArrayIterator", | ||
| next: lc_std_array_iterator_next | ||
| } | ||
| const LCC_Array = { | ||
| __proto__: Array.prototype, | ||
| getIterator: lc_std_array_getIterator | ||
| } | ||
| function lc_std_array_iterator_next() { | ||
| if (this.index >= this.content.length) { | ||
| return [LCC_Option, 1]; | ||
| } | ||
| const t = this.content[this.index++]; | ||
| return [LCC_Option, 0, t]; | ||
| } | ||
| function lc_std_array_getIterator() { | ||
| return { | ||
| __proto__: LCC_ArrayIterator, | ||
| content: this, | ||
| index: 0 | ||
| } | ||
| } | ||
| function lc_new_array(len) { | ||
| const tmp = Array(len) | ||
| tmp.__proto__ = LCC_Array; | ||
| return tmp; | ||
| } | ||
| function lc_std_array_filter(filter) { | ||
@@ -245,0 +278,0 @@ return Array.prototype.filter.call(this, filter); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
121815
2.55%359
8.46%