Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
eoussama committed Mar 20, 2024
1 parent 0394b3f commit ca40aee
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/loops.nkm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
hear me out i is 0;

cook until (i > 10) {
cook until (i > (10 - 1)) {
loncina("iteration " + bait(i));
i is i + 1;
}
13 changes: 13 additions & 0 deletions scripts/power.nkm
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
let me cook power(a, b) {
hear me out result is 1;
hear me out index is 0;

cook until (index + 1 > b) {
result is result * a;
index is index + 1;
}

reda result;
}

reda power(2, 3); bs Output: 8
1 change: 0 additions & 1 deletion src/frontend/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ export class Parser extends Consumer<TToken> {
if (this.at().type === TokenType.Equals) {
this.eat();
const right = this.parseAssignmentExpression();
this.expect(TokenType.Semicolon, new MissingDotError(this.at().location));

return {
value: right,
Expand Down

0 comments on commit ca40aee

Please sign in to comment.