bahasa-simpl 1.0.4 → 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.
|
@@ -894,8 +894,11 @@ class Interpreter {
|
|
|
894
894
|
let main = memberExpr.main.accept(this);
|
|
895
895
|
let name = memberExpr.member.token.lexeme;
|
|
896
896
|
this.line = memberExpr.member.token.line;
|
|
897
|
-
if (!main
|
|
897
|
+
if (!main?.member || !main.member.has(name)) {
|
|
898
898
|
const type = this.environment.get(main.type.description);
|
|
899
|
+
if (!type) {
|
|
900
|
+
this.error(`nama .${name} tidak ditemukan.`);
|
|
901
|
+
}
|
|
899
902
|
if (type.member?.has(name)) {
|
|
900
903
|
if (willBeCalled) {
|
|
901
904
|
this.objectStack = main;
|
|
@@ -2022,7 +2025,7 @@ class Parser {
|
|
|
2022
2025
|
|
|
2023
2026
|
while (this.match(PIPE)) {
|
|
2024
2027
|
let op = this.previous();
|
|
2025
|
-
let right = this.
|
|
2028
|
+
let right = this.andTerm();
|
|
2026
2029
|
expr = new Binary(expr, op, right);
|
|
2027
2030
|
}
|
|
2028
2031
|
|