cashc 0.7.2 → 0.7.4
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/main/ast/AST.d.ts +2 -2
- package/dist/main/ast/AstBuilder.js +2 -3
- package/dist/main/grammar/CashScriptParser.d.ts +2 -1
- package/dist/main/grammar/CashScriptParser.js +296 -284
- package/dist/main/index.d.ts +1 -1
- package/dist/main/index.js +1 -1
- package/dist/main/semantic/SymbolTableTraversal.js +9 -6
- package/dist/main/semantic/TypeCheckTraversal.js +1 -1
- package/dist/module/ast/AST.d.ts +2 -2
- package/dist/module/ast/AstBuilder.js +2 -3
- package/dist/module/grammar/CashScriptParser.d.ts +2 -1
- package/dist/module/grammar/CashScriptParser.js +296 -284
- package/dist/module/index.d.ts +1 -1
- package/dist/module/index.js +1 -1
- package/dist/module/semantic/SymbolTableTraversal.js +9 -6
- package/dist/module/semantic/TypeCheckTraversal.js +1 -1
- package/package.json +3 -3
package/dist/module/index.d.ts
CHANGED
package/dist/module/index.js
CHANGED
|
@@ -2,5 +2,5 @@ export * from './Errors.js';
|
|
|
2
2
|
import * as utils_1 from '@cashscript/utils';
|
|
3
3
|
export { utils_1 as utils };
|
|
4
4
|
export { compileFile, compileString } from './compiler.js';
|
|
5
|
-
export const version = '0.7.
|
|
5
|
+
export const version = '0.7.4';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -68,20 +68,23 @@ export default class SymbolTableTraversal extends AstTraversal {
|
|
|
68
68
|
return node;
|
|
69
69
|
}
|
|
70
70
|
visitAssign(node) {
|
|
71
|
-
var _a;
|
|
71
|
+
var _a, _b;
|
|
72
72
|
const v = (_a = this.symbolTables[0].get(node.identifier.name)) === null || _a === void 0 ? void 0 : _a.definition;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
// const used_modifiers = [] # PREVENT USER FROM USING SAME MODIFIER AGAIN
|
|
74
|
+
(_b = v === null || v === void 0 ? void 0 : v.modifier) === null || _b === void 0 ? void 0 : _b.forEach((modifier) => {
|
|
75
|
+
if (modifier === Modifier.CONSTANT) {
|
|
76
|
+
throw new ConstantModificationError(v);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
76
79
|
super.visitAssign(node);
|
|
77
80
|
return node;
|
|
78
81
|
}
|
|
79
82
|
visitTupleAssignment(node) {
|
|
80
83
|
[node.var1, node.var2].forEach(({ name, type }) => {
|
|
81
84
|
if (this.symbolTables[0].get(name)) {
|
|
82
|
-
throw new VariableRedefinitionError(new VariableDefinitionNode(type,
|
|
85
|
+
throw new VariableRedefinitionError(new VariableDefinitionNode(type, [], name, node.tuple));
|
|
83
86
|
}
|
|
84
|
-
this.symbolTables[0].set(Symbol.variable(new VariableDefinitionNode(type,
|
|
87
|
+
this.symbolTables[0].set(Symbol.variable(new VariableDefinitionNode(type, [], name, node.tuple)));
|
|
85
88
|
});
|
|
86
89
|
node.tuple = this.visit(node.tuple);
|
|
87
90
|
return node;
|
|
@@ -22,7 +22,7 @@ export default class TypeCheckTraversal extends AstTraversal {
|
|
|
22
22
|
if (tupleType instanceof BytesType && variable.type instanceof BytesType) {
|
|
23
23
|
return node;
|
|
24
24
|
}
|
|
25
|
-
throw new AssignTypeError(new VariableDefinitionNode(variable.type,
|
|
25
|
+
throw new AssignTypeError(new VariableDefinitionNode(variable.type, [], variable.name, node.tuple));
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
return node;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cashc",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.4",
|
|
4
4
|
"description": "Compile Bitcoin Cash contracts to Bitcoin Cash Script or artifacts",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bitcoin",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@bitauth/libauth": "^1.18.1",
|
|
50
|
-
"@cashscript/utils": "^0.7.
|
|
50
|
+
"@cashscript/utils": "^0.7.4",
|
|
51
51
|
"antlr4ts": "^0.5.0-alpha.4",
|
|
52
52
|
"commander": "^7.1.0",
|
|
53
53
|
"semver": "^7.3.4"
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"ts-jest": "^26.5.1",
|
|
60
60
|
"typescript": "^4.1.5"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "21624782464044609cb6e018a8d8afd028db01d5"
|
|
63
63
|
}
|