@harmoniclabs/pebble 0.2.0 → 0.3.0
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/dist/IR/CompilationCtx.d.ts +40 -0
- package/dist/IR/CompilationCtx.js +54 -0
- package/dist/IR/IRHash.d.ts +23 -2
- package/dist/IR/IRHash.js +10 -60
- package/dist/IR/IRNodes/IRConst.js +22 -2
- package/dist/IR/IRNodes/IRHoisted.d.ts +0 -1
- package/dist/IR/IRNodes/IRHoisted.js +4 -6
- package/dist/IR/IRNodes/IRLetted.d.ts +0 -1
- package/dist/IR/IRNodes/IRLetted.js +4 -6
- package/dist/IR/IRNodes/IRNative/IRNativeTag.d.ts +22 -2
- package/dist/IR/IRNodes/IRNative/IRNativeTag.js +26 -2
- package/dist/IR/IRNodes/IRNative/index.d.ts +16 -1
- package/dist/IR/IRNodes/IRNative/index.js +27 -2
- package/dist/IR/IRNodes/utils/hashVarSym.d.ts +0 -1
- package/dist/IR/IRNodes/utils/hashVarSym.js +27 -33
- package/dist/IR/toUPLC/CompilerOptions.d.ts +12 -0
- package/dist/IR/toUPLC/CompilerOptions.js +14 -9
- package/dist/IR/toUPLC/compileIRToUPLC.js +39 -3
- package/dist/IR/toUPLC/subRoutines/inlineSingleUseLetBindingsAndReturnRoot.d.ts +23 -0
- package/dist/IR/toUPLC/subRoutines/inlineSingleUseLetBindingsAndReturnRoot.js +263 -0
- package/dist/IR/toUPLC/subRoutines/introduceCaseForDualHeadTailAndReturnRoot.d.ts +35 -0
- package/dist/IR/toUPLC/subRoutines/introduceCaseForDualHeadTailAndReturnRoot.js +169 -0
- package/dist/IR/toUPLC/subRoutines/replaceHoistedWithLetted.d.ts +0 -1
- package/dist/IR/toUPLC/subRoutines/replaceHoistedWithLetted.js +6 -6
- package/dist/IR/toUPLC/subRoutines/replaceNatives/nativeToIR.d.ts +2 -3
- package/dist/IR/toUPLC/subRoutines/replaceNatives/nativeToIR.js +106 -65
- package/dist/IR/toUPLC/subRoutines/rewriteHeadTailInCaseConsAndReturnRoot.d.ts +30 -0
- package/dist/IR/toUPLC/subRoutines/rewriteHeadTailInCaseConsAndReturnRoot.js +95 -0
- package/dist/IR/toUPLC/subRoutines/rewriteNativesAppliedToConstantsAndReturnRoot.js +36 -5
- package/dist/IR/toUPLC/subRoutines/rewriteToCaseOverConstAndReturnRoot.d.ts +35 -0
- package/dist/IR/toUPLC/subRoutines/rewriteToCaseOverConstAndReturnRoot.js +169 -0
- package/dist/IR/tree_utils/_ir_caseList.d.ts +15 -0
- package/dist/IR/tree_utils/_ir_caseList.js +19 -0
- package/dist/ast/nodes/statements/declarations/StructDecl.d.ts +16 -2
- package/dist/ast/nodes/statements/declarations/StructDecl.js +15 -1
- package/dist/compiler/AstCompiler/AstCompiler.d.ts +1 -0
- package/dist/compiler/AstCompiler/AstCompiler.js +41 -4
- package/dist/compiler/AstCompiler/internal/_deriveContractBody/_deriveContractBody.js +3 -3
- package/dist/compiler/AstCompiler/internal/exprs/_compileCaseExpr.js +31 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compileIsExpr.js +12 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compilePropAccessExpr.js +36 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compileUnaryPrefixExpr.js +13 -1
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileAddExpr.js +18 -5
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileEqualExpr.js +3 -1
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileGreaterThanEqualExpr.js +2 -1
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileGreaterThanExpr.js +2 -1
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileLessThanEqualExpr.js +2 -1
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileLessThanExpr.js +2 -1
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileMultExpr.js +24 -6
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileNotEqualExpr.js +2 -1
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileSubExpr.js +16 -5
- package/dist/compiler/AstCompiler/internal/statements/_compileMatchStmt.js +33 -20
- package/dist/compiler/AstCompiler/utils/getPropAccessReturnType.js +11 -0
- package/dist/compiler/Compiler.js +20 -27
- package/dist/compiler/TirCompiler/expressify/ExpressifyCtx.js +1 -1
- package/dist/compiler/TirCompiler/expressify/expressify.js +30 -2
- package/dist/compiler/TirCompiler/expressify/expressifyForStmt.d.ts +2 -1
- package/dist/compiler/TirCompiler/expressify/expressifyForStmt.js +45 -7
- package/dist/compiler/TirCompiler/expressify/expressifyVars.d.ts +0 -1
- package/dist/compiler/TirCompiler/expressify/expressifyVars.js +23 -8
- package/dist/compiler/tir/expressions/TirCaseExpr.d.ts +9 -0
- package/dist/compiler/tir/expressions/TirCaseExpr.js +144 -122
- package/dist/compiler/tir/expressions/TirElemAccessExpr.js +2 -2
- package/dist/compiler/tir/expressions/TirFromDataExpr.js +102 -67
- package/dist/compiler/tir/expressions/TirIsExpr.js +14 -1
- package/dist/compiler/tir/expressions/TirNativeFunc.d.ts +1 -2
- package/dist/compiler/tir/expressions/TirNativeFunc.js +2 -12
- package/dist/compiler/tir/expressions/TirToDataExpr.js +3 -0
- package/dist/compiler/tir/expressions/TirTypeConversionExpr.js +10 -0
- package/dist/compiler/tir/expressions/TirVariableAccessExpr.d.ts +2 -3
- package/dist/compiler/tir/expressions/TirVariableAccessExpr.js +1 -4
- package/dist/compiler/tir/expressions/ToIRTermCtx.d.ts +20 -3
- package/dist/compiler/tir/expressions/ToIRTermCtx.js +48 -3
- package/dist/compiler/tir/expressions/binary/TirBinaryExpr.d.ts +2 -2
- package/dist/compiler/tir/expressions/binary/TirBinaryExpr.js +45 -8
- package/dist/compiler/tir/expressions/litteral/TirLitEnumMemberExpr.d.ts +19 -0
- package/dist/compiler/tir/expressions/litteral/TirLitEnumMemberExpr.js +24 -0
- package/dist/compiler/tir/expressions/litteral/TirLitteralExpr.d.ts +2 -1
- package/dist/compiler/tir/expressions/litteral/TirLitteralExpr.js +2 -0
- package/dist/compiler/tir/expressions/unary/TirUnaryMinus.js +4 -1
- package/dist/compiler/tir/program/stdScope/populateStdNamespace.js +49 -4
- package/dist/compiler/tir/program/stdScope/prelude/preludeTypesSrc.js +35 -2
- package/dist/compiler/tir/program/stdScope/stdScope.d.ts +7 -0
- package/dist/compiler/tir/program/stdScope/stdScope.js +83 -40
- package/dist/compiler/tir/types/TirEnumType.d.ts +21 -0
- package/dist/compiler/tir/types/TirEnumType.js +36 -0
- package/dist/compiler/tir/types/TirNativeType/TirNativeType.d.ts +4 -2
- package/dist/compiler/tir/types/TirNativeType/TirNativeType.js +5 -0
- package/dist/compiler/tir/types/TirNativeType/native/array.d.ts +16 -0
- package/dist/compiler/tir/types/TirNativeType/native/array.js +38 -0
- package/dist/compiler/tir/types/TirNativeType/native/index.d.ts +2 -0
- package/dist/compiler/tir/types/TirNativeType/native/index.js +2 -0
- package/dist/compiler/tir/types/TirNativeType/native/value.d.ts +18 -0
- package/dist/compiler/tir/types/TirNativeType/native/value.js +17 -0
- package/dist/compiler/tir/types/TirStructType.js +6 -1
- package/dist/compiler/tir/types/TirType.d.ts +3 -2
- package/dist/compiler/tir/types/TirType.js +4 -1
- package/dist/compiler/tir/types/utils/canAssignTo.js +28 -0
- package/dist/compiler/tir/types/utils/canCastTo.js +14 -1
- package/dist/compiler/tir/types/utils/getDeconstructableType.d.ts +2 -1
- package/dist/compiler/tir/types/utils/getDeconstructableType.js +2 -0
- package/dist/compiler/tir/types/utils/inferTypeArgs.js +4 -0
- package/dist/compiler/tir/types/utils/normalizeEnumToInt.d.ts +10 -0
- package/dist/compiler/tir/types/utils/normalizeEnumToInt.js +17 -0
- package/dist/compiler/tir/types/utils/substituteTypeParams.js +5 -0
- package/dist/diagnostics/diagnosticMessages.generated.d.ts +5 -0
- package/dist/diagnostics/diagnosticMessages.generated.js +10 -0
- package/dist/parser/Parser.js +29 -13
- package/dist/tokenizer/Token.d.ts +8 -7
- package/dist/tokenizer/Token.js +8 -7
- package/dist/tokenizer/utils/tokenFromKeyword.js +2 -0
- package/dist/version.generated.d.ts +1 -1
- package/dist/version.generated.js +1 -1
- package/package.json +3 -3
- package/dist/IR/tree_utils/_ir_lazyChooseList.d.ts +0 -3
- package/dist/IR/tree_utils/_ir_lazyChooseList.js +0 -7
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TirAliasType } from "../TirAliasType.js";
|
|
2
|
+
import { TirEnumType } from "../TirEnumType.js";
|
|
3
|
+
/**
|
|
4
|
+
* If `t` is an enum type (or alias of one), returns the shared `int` type
|
|
5
|
+
* (since enums lower to plain ints at runtime). Otherwise returns `t`.
|
|
6
|
+
*
|
|
7
|
+
* Use this to relax type checks for binary operators that treat enums as
|
|
8
|
+
* integers (arithmetic, comparison, equality).
|
|
9
|
+
*/
|
|
10
|
+
export function normalizeEnumToInt(t, int_t) {
|
|
11
|
+
let probe = t;
|
|
12
|
+
while (probe instanceof TirAliasType)
|
|
13
|
+
probe = probe.aliased;
|
|
14
|
+
if (probe instanceof TirEnumType)
|
|
15
|
+
return int_t;
|
|
16
|
+
return t;
|
|
17
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TirAliasType } from "../TirAliasType.js";
|
|
2
|
+
import { TirArrayT } from "../TirNativeType/native/array.js";
|
|
2
3
|
import { TirFuncT } from "../TirNativeType/native/function.js";
|
|
3
4
|
import { TirLinearMapT } from "../TirNativeType/native/linearMap.js";
|
|
4
5
|
import { TirLinearMapEntryT } from "../TirNativeType/native/linearMapEntry.js";
|
|
@@ -23,6 +24,10 @@ export function substituteTypeParams(t, subst) {
|
|
|
23
24
|
const sub = substituteTypeParams(t.typeArg, subst);
|
|
24
25
|
return sub === t.typeArg ? t : new TirListT(sub);
|
|
25
26
|
}
|
|
27
|
+
if (t instanceof TirArrayT) {
|
|
28
|
+
const sub = substituteTypeParams(t.typeArg, subst);
|
|
29
|
+
return sub === t.typeArg ? t : new TirArrayT(sub);
|
|
30
|
+
}
|
|
26
31
|
if (t instanceof TirFuncT) {
|
|
27
32
|
let changed = false;
|
|
28
33
|
const newArgs = t.argTypes.map(a => {
|
|
@@ -283,6 +283,11 @@ export declare enum DiagnosticCode {
|
|
|
283
283
|
_private_modifier_is_only_allowed_on_declarations_inside_a_namespace = 30003,
|
|
284
284
|
Namespaces_cannot_be_declared_here = 30004,
|
|
285
285
|
_0_is_not_a_namespace = 30005,
|
|
286
|
+
Enum_members_cannot_have_explicit_values = 30100,
|
|
287
|
+
Duplicate_enum_member_0 = 30101,
|
|
288
|
+
Enum_must_have_at_least_one_member = 30102,
|
|
289
|
+
Property_0_is_not_a_member_of_enum_1 = 30103,
|
|
290
|
+
Enum_member_pattern_cannot_have_fields = 30104,
|
|
286
291
|
Dev_was_too_lazy_to_add_a_prooper_error_message_Something_went_wrong = 42069
|
|
287
292
|
}
|
|
288
293
|
/** Translates a diagnostic code to its respective string. */
|
|
@@ -285,6 +285,11 @@ export var DiagnosticCode;
|
|
|
285
285
|
DiagnosticCode[DiagnosticCode["_private_modifier_is_only_allowed_on_declarations_inside_a_namespace"] = 30003] = "_private_modifier_is_only_allowed_on_declarations_inside_a_namespace";
|
|
286
286
|
DiagnosticCode[DiagnosticCode["Namespaces_cannot_be_declared_here"] = 30004] = "Namespaces_cannot_be_declared_here";
|
|
287
287
|
DiagnosticCode[DiagnosticCode["_0_is_not_a_namespace"] = 30005] = "_0_is_not_a_namespace";
|
|
288
|
+
DiagnosticCode[DiagnosticCode["Enum_members_cannot_have_explicit_values"] = 30100] = "Enum_members_cannot_have_explicit_values";
|
|
289
|
+
DiagnosticCode[DiagnosticCode["Duplicate_enum_member_0"] = 30101] = "Duplicate_enum_member_0";
|
|
290
|
+
DiagnosticCode[DiagnosticCode["Enum_must_have_at_least_one_member"] = 30102] = "Enum_must_have_at_least_one_member";
|
|
291
|
+
DiagnosticCode[DiagnosticCode["Property_0_is_not_a_member_of_enum_1"] = 30103] = "Property_0_is_not_a_member_of_enum_1";
|
|
292
|
+
DiagnosticCode[DiagnosticCode["Enum_member_pattern_cannot_have_fields"] = 30104] = "Enum_member_pattern_cannot_have_fields";
|
|
288
293
|
DiagnosticCode[DiagnosticCode["Dev_was_too_lazy_to_add_a_prooper_error_message_Something_went_wrong"] = 42069] = "Dev_was_too_lazy_to_add_a_prooper_error_message_Something_went_wrong";
|
|
289
294
|
})(DiagnosticCode || (DiagnosticCode = {}));
|
|
290
295
|
/** Translates a diagnostic code to its respective string. */
|
|
@@ -573,6 +578,11 @@ export function diagnosticCodeToString(code) {
|
|
|
573
578
|
case 30003: return "'private' modifier is only allowed on declarations inside a namespace.";
|
|
574
579
|
case 30004: return "Namespaces cannot be declared here.";
|
|
575
580
|
case 30005: return "'{0}' is not a namespace.";
|
|
581
|
+
case 30100: return "Enum members cannot have explicit values.";
|
|
582
|
+
case 30101: return "Duplicate enum member '{0}'.";
|
|
583
|
+
case 30102: return "Enum must have at least one member.";
|
|
584
|
+
case 30103: return "Property '{0}' is not a member of enum '{1}'.";
|
|
585
|
+
case 30104: return "Enum member pattern cannot have fields.";
|
|
576
586
|
case 42069: return "Dev was too lazy to add a prooper error message. Something went wrong";
|
|
577
587
|
default: return "";
|
|
578
588
|
}
|
package/dist/parser/Parser.js
CHANGED
|
@@ -178,13 +178,19 @@ export class Parser extends DiagnosticEmitter {
|
|
|
178
178
|
case Token.Data: {
|
|
179
179
|
// `next()` skips `data` keyword
|
|
180
180
|
tn.next();
|
|
181
|
+
let extraFlags = StructDeclAstFlags.onlyDataEncoding;
|
|
182
|
+
// accept `data untagged struct ...`
|
|
183
|
+
if (tn.peek() === Token.Untagged) {
|
|
184
|
+
tn.next();
|
|
185
|
+
extraFlags |= StructDeclAstFlags.untagged;
|
|
186
|
+
}
|
|
181
187
|
// positions on (expected) `struct` keyword
|
|
182
188
|
if (tn.peek() !== Token.Struct) {
|
|
183
189
|
console.error(Token[tn.peek()]);
|
|
184
190
|
return this.error(DiagnosticCode._0_expected, tn.range(), "struct");
|
|
185
191
|
}
|
|
186
192
|
tn.next(); // skip `struct`
|
|
187
|
-
statement = this.parseStruct(
|
|
193
|
+
statement = this.parseStruct(extraFlags, flags, startPos);
|
|
188
194
|
break;
|
|
189
195
|
}
|
|
190
196
|
case Token.Runtime: {
|
|
@@ -203,6 +209,22 @@ export class Parser extends DiagnosticEmitter {
|
|
|
203
209
|
statement = this.parseStruct(StructDeclAstFlags.none, flags, startPos);
|
|
204
210
|
break;
|
|
205
211
|
}
|
|
212
|
+
case Token.Untagged: {
|
|
213
|
+
// `untagged` keyword forces listData encoding (single ctor).
|
|
214
|
+
// Accept: `untagged struct ...` or `untagged data struct ...`.
|
|
215
|
+
tn.next(); // skip `untagged`
|
|
216
|
+
let extraFlags = StructDeclAstFlags.untagged;
|
|
217
|
+
if (tn.peek() === Token.Data) {
|
|
218
|
+
tn.next(); // skip `data`
|
|
219
|
+
extraFlags |= StructDeclAstFlags.onlyDataEncoding;
|
|
220
|
+
}
|
|
221
|
+
if (tn.peek() !== Token.Struct) {
|
|
222
|
+
return this.error(DiagnosticCode._0_expected, tn.range(), "struct");
|
|
223
|
+
}
|
|
224
|
+
tn.next(); // skip `struct`
|
|
225
|
+
statement = this.parseStruct(extraFlags, flags, startPos);
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
206
228
|
case Token.Interface: {
|
|
207
229
|
tn.next();
|
|
208
230
|
statement = this.parseInterface(flags, startPos);
|
|
@@ -884,7 +906,7 @@ export class Parser extends DiagnosticEmitter {
|
|
|
884
906
|
[
|
|
885
907
|
new StructConstrDecl(new Identifier(name.text, name.range), [], // fields
|
|
886
908
|
range)
|
|
887
|
-
], structDeclFlags | StructDeclAstFlags.
|
|
909
|
+
], structDeclFlags | StructDeclAstFlags.shortcutSingleConstructor, range.clone());
|
|
888
910
|
}
|
|
889
911
|
let constrIdentifier = undefined;
|
|
890
912
|
// in case of single constr shortcut
|
|
@@ -905,7 +927,7 @@ export class Parser extends DiagnosticEmitter {
|
|
|
905
927
|
tn.skip(Token.Semicolon); // if any
|
|
906
928
|
return new StructDecl(name, typeParams, [
|
|
907
929
|
new StructConstrDecl(new Identifier(name.text, name.range), fields, tn.range(startPos, tn.pos))
|
|
908
|
-
], structDeclFlags | StructDeclAstFlags.
|
|
930
|
+
], structDeclFlags | StructDeclAstFlags.shortcutSingleConstructor, tn.range(startPos, tn.pos));
|
|
909
931
|
}
|
|
910
932
|
const constrFields = this.parseStructConstrFields(flags);
|
|
911
933
|
if (!Array.isArray(constrFields))
|
|
@@ -1885,17 +1907,14 @@ export class Parser extends DiagnosticEmitter {
|
|
|
1885
1907
|
const expr = this.parseExpr(Precedence.Relational + 1);
|
|
1886
1908
|
if (!expr)
|
|
1887
1909
|
return undefined;
|
|
1888
|
-
let noPatternCaseSeen = false;
|
|
1889
1910
|
const cases = new Array();
|
|
1890
1911
|
while (tn.skip(Token.Is)) {
|
|
1891
|
-
if (noPatternCaseSeen)
|
|
1892
|
-
return this.error(DiagnosticCode.This_case_will_never_be_evaluated_because_all_patterns_will_be_catched_before, tn.range());
|
|
1893
1912
|
const startPos = tn.tokenPos;
|
|
1894
1913
|
const matcher = this._parseVarDecl(CommonFlags.Const);
|
|
1895
1914
|
if (!matcher)
|
|
1896
1915
|
return undefined;
|
|
1897
|
-
|
|
1898
|
-
|
|
1916
|
+
// SimpleVarDecl patterns are validated by the AstCompiler, which
|
|
1917
|
+
// has type info (enum-member promotion vs invalid catch-all).
|
|
1899
1918
|
if (matcher.initExpr || matcher.type)
|
|
1900
1919
|
return this.error(DiagnosticCode.Patterns_may_not_have_initializers_or_explicit_types, matcher.initExpr ? matcher.initExpr.range : matcher.type.range);
|
|
1901
1920
|
if (!tn.skip(Token.FatArrow))
|
|
@@ -2626,7 +2645,6 @@ export class Parser extends DiagnosticEmitter {
|
|
|
2626
2645
|
return this.error(DiagnosticCode.Expression_expected, tn.range(startPos - 5, startPos));
|
|
2627
2646
|
if (!tn.skip(Token.OpenBrace))
|
|
2628
2647
|
return this.error(DiagnosticCode._0_expected, tn.range(), "{");
|
|
2629
|
-
let noPatternCaseSeen = false;
|
|
2630
2648
|
const cases = new Array();
|
|
2631
2649
|
while (!tn.skip(Token.CloseBrace)
|
|
2632
2650
|
&& tn.peek() !== Token.Else) {
|
|
@@ -2637,10 +2655,8 @@ export class Parser extends DiagnosticEmitter {
|
|
|
2637
2655
|
const pattern = this._parseVarDecl(CommonFlags.Const, true);
|
|
2638
2656
|
if (!pattern)
|
|
2639
2657
|
return this.error(DiagnosticCode.Pattern_expected, tn.range());
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
if (pattern instanceof SimpleVarDecl)
|
|
2643
|
-
noPatternCaseSeen = true;
|
|
2658
|
+
// SimpleVarDecl patterns are validated by the AstCompiler, which
|
|
2659
|
+
// has type info (enum-member promotion vs invalid catch-all).
|
|
2644
2660
|
if (!tn.skip(Token.Colon))
|
|
2645
2661
|
return this.error(DiagnosticCode._0_expected, tn.range(), ":");
|
|
2646
2662
|
const statePreBody = tn.mark();
|
|
@@ -164,11 +164,12 @@ export declare enum Token {
|
|
|
164
164
|
List = 117,
|
|
165
165
|
LinearMap = 118,
|
|
166
166
|
Runtime = 119,
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
167
|
+
Untagged = 120,
|
|
168
|
+
Identifier = 121,
|
|
169
|
+
StringLiteral = 122,
|
|
170
|
+
HexBytesLiteral = 123,
|
|
171
|
+
IntegerLiteral = 124,
|
|
172
|
+
StringTemplateLiteralQuote = 125,
|
|
173
|
+
Invalid = 126,
|
|
174
|
+
EndOfFile = 127
|
|
174
175
|
}
|
package/dist/tokenizer/Token.js
CHANGED
|
@@ -204,16 +204,17 @@ export var Token;
|
|
|
204
204
|
// struct decl modifiers
|
|
205
205
|
// taggedModifier, // `tagged` data struct
|
|
206
206
|
Token[Token["Runtime"] = 119] = "Runtime";
|
|
207
|
+
Token[Token["Untagged"] = 120] = "Untagged";
|
|
207
208
|
// literals
|
|
208
|
-
Token[Token["Identifier"] =
|
|
209
|
-
Token[Token["StringLiteral"] =
|
|
210
|
-
Token[Token["HexBytesLiteral"] =
|
|
211
|
-
Token[Token["IntegerLiteral"] =
|
|
209
|
+
Token[Token["Identifier"] = 121] = "Identifier";
|
|
210
|
+
Token[Token["StringLiteral"] = 122] = "StringLiteral";
|
|
211
|
+
Token[Token["HexBytesLiteral"] = 123] = "HexBytesLiteral";
|
|
212
|
+
Token[Token["IntegerLiteral"] = 124] = "IntegerLiteral";
|
|
212
213
|
// FloatLiteral,
|
|
213
|
-
Token[Token["StringTemplateLiteralQuote"] =
|
|
214
|
+
Token[Token["StringTemplateLiteralQuote"] = 125] = "StringTemplateLiteralQuote";
|
|
214
215
|
// meta
|
|
215
|
-
Token[Token["Invalid"] =
|
|
216
|
-
Token[Token["EndOfFile"] =
|
|
216
|
+
Token[Token["Invalid"] = 126] = "Invalid";
|
|
217
|
+
Token[Token["EndOfFile"] = 127] = "EndOfFile";
|
|
217
218
|
})(Token || (Token = {}));
|
|
218
219
|
Object.freeze(Token);
|
|
219
220
|
/*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const COMPILER_VERSION = "0.
|
|
1
|
+
export declare const COMPILER_VERSION = "0.3.0";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// This file is auto-generated by scripts/genVersion.js. Do not edit.
|
|
2
|
-
export const COMPILER_VERSION = "0.
|
|
2
|
+
export const COMPILER_VERSION = "0.3.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@harmoniclabs/pebble",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "A simple, yet rock solid, functional language with an imperative bias, targeting UPLC",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -53,12 +53,12 @@
|
|
|
53
53
|
"homepage": "https://github.com/HarmonicLabs/pebble#readme",
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@harmoniclabs/bigint-utils": "^1.0.0",
|
|
56
|
-
"@harmoniclabs/cardano-costmodels-ts": "^1.
|
|
56
|
+
"@harmoniclabs/cardano-costmodels-ts": "^1.6.1",
|
|
57
57
|
"@harmoniclabs/cbor": "^2.0.1",
|
|
58
58
|
"@harmoniclabs/crypto": "^0.3.0",
|
|
59
59
|
"@harmoniclabs/obj-utils": "^1.0.0",
|
|
60
60
|
"@harmoniclabs/plutus-data": "^2.0.1",
|
|
61
|
-
"@harmoniclabs/plutus-machine": "^3.0.
|
|
61
|
+
"@harmoniclabs/plutus-machine": "^3.0.3",
|
|
62
62
|
"@harmoniclabs/uint8array-utils": "^1.0.4",
|
|
63
63
|
"@harmoniclabs/uplc": "^2.0.5"
|
|
64
64
|
},
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { _ir_apps } from "../IRNodes/IRApp.js";
|
|
2
|
-
import { IRDelayed } from "../IRNodes/IRDelayed.js";
|
|
3
|
-
import { IRForced } from "../IRNodes/IRForced.js";
|
|
4
|
-
import { IRNative } from "../IRNodes/IRNative/index.js";
|
|
5
|
-
export function _ir_lazyChooseList(listTerm, caseNil, caseCons) {
|
|
6
|
-
return new IRForced(_ir_apps(IRNative.strictChooseList, listTerm, new IRDelayed(caseNil), new IRDelayed(caseCons)));
|
|
7
|
-
}
|