bahasa-simpl 1.0.3 → 1.0.5
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.
|
@@ -689,7 +689,10 @@ class Interpreter {
|
|
|
689
689
|
|
|
690
690
|
for (let expr of arrayExpr.contents) {
|
|
691
691
|
let v = this.validValue(expr.accept(this));
|
|
692
|
-
|
|
692
|
+
let newVar = new Variable(v.type, false, v.data);
|
|
693
|
+
newVar.member = v.member;
|
|
694
|
+
newVar.isDatum = true;
|
|
695
|
+
value.data.push(newVar);
|
|
693
696
|
}
|
|
694
697
|
|
|
695
698
|
return value;
|
|
@@ -891,8 +894,11 @@ class Interpreter {
|
|
|
891
894
|
let main = memberExpr.main.accept(this);
|
|
892
895
|
let name = memberExpr.member.token.lexeme;
|
|
893
896
|
this.line = memberExpr.member.token.line;
|
|
894
|
-
if (!main
|
|
897
|
+
if (!main?.member || !main.member.has(name)) {
|
|
895
898
|
const type = this.environment.get(main.type.description);
|
|
899
|
+
if (!type) {
|
|
900
|
+
this.error(`nama .${name} tidak ditemukan.`);
|
|
901
|
+
}
|
|
896
902
|
if (type.member?.has(name)) {
|
|
897
903
|
if (willBeCalled) {
|
|
898
904
|
this.objectStack = main;
|
|
@@ -2019,7 +2025,7 @@ class Parser {
|
|
|
2019
2025
|
|
|
2020
2026
|
while (this.match(PIPE)) {
|
|
2021
2027
|
let op = this.previous();
|
|
2022
|
-
let right = this.
|
|
2028
|
+
let right = this.andTerm();
|
|
2023
2029
|
expr = new Binary(expr, op, right);
|
|
2024
2030
|
}
|
|
2025
2031
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bahasa-simpl",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Simpl: Indonesian Mini Programming Language interpreter",
|
|
5
5
|
"main": "./dist/simpl-interpreter.js",
|
|
6
6
|
"scripts": {
|
|
@@ -20,5 +20,8 @@
|
|
|
20
20
|
"homepage": "https://github.com/faeiz-ff/simpl#readme",
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"rollup": "^4.53.3"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"bahasa-simpl": "^1.0.3"
|
|
23
26
|
}
|
|
24
27
|
}
|