bahasa-simpl 1.0.8 → 1.0.9
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/simpl-interpreter.js +15 -4
- package/package.json +1 -1
|
@@ -454,8 +454,7 @@ let Jenis$1 = class Jenis extends Stipe {
|
|
|
454
454
|
this.member.define(thing.lexeme, new Value(sym, idx));
|
|
455
455
|
});
|
|
456
456
|
this.member.define("kePetik", makeBuiltInFunc([sym], petikSymbol, (_, [j]) => {
|
|
457
|
-
|
|
458
|
-
return new Value(petikSymbol, `${name}.${enumName}`);
|
|
457
|
+
return new Value(petikSymbol, `${name}<${j.data}>`);
|
|
459
458
|
}));
|
|
460
459
|
this.init(sym);
|
|
461
460
|
}
|
|
@@ -1404,6 +1403,17 @@ class Lexer {
|
|
|
1404
1403
|
this.charStart++;
|
|
1405
1404
|
}
|
|
1406
1405
|
|
|
1406
|
+
multilineComment() {
|
|
1407
|
+
this.advance(); this.advance();
|
|
1408
|
+
this.charStart = this.charStart + 2;
|
|
1409
|
+
while (!this.isAtEnd() && (this.see() !== '*' || this.peek() !== '/')) {
|
|
1410
|
+
this.advance();
|
|
1411
|
+
this.charStart++;
|
|
1412
|
+
}
|
|
1413
|
+
this.advance(); this.advance();
|
|
1414
|
+
this.charStart = this.charStart + 2;
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1407
1417
|
makeToken(type) {
|
|
1408
1418
|
this.advance();
|
|
1409
1419
|
return new Token(type, this.parseLexeme(), null, this.lineIndex);
|
|
@@ -1411,8 +1421,9 @@ class Lexer {
|
|
|
1411
1421
|
|
|
1412
1422
|
scan() {
|
|
1413
1423
|
this.skipWhitespaces();
|
|
1414
|
-
while (this.see() === '#') {
|
|
1415
|
-
this.comment();
|
|
1424
|
+
while (this.see() === '#' || (this.see() === '/' && this.peek() === '*')) {
|
|
1425
|
+
if (this.see() === '#') this.comment();
|
|
1426
|
+
else this.multilineComment();
|
|
1416
1427
|
this.skipWhitespaces();
|
|
1417
1428
|
}
|
|
1418
1429
|
|