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

Commit

Permalink
This fixes #27
Browse files Browse the repository at this point in the history
  • Loading branch information
SahilK-027 committed Aug 7, 2023
1 parent d3787bf commit 3ace7b9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
16 changes: 16 additions & 0 deletions FrontEnd/lexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,22 @@ export function tokenize(sourceCode: string): Token[] {
}
}

if (src[0] === "'") {
src.shift(); // Consume the opening double quote
let string = "";

while (src.length > 0 && src[0] !== "'") {
string += src.shift();
}

if (src[0] === "'") {
src.shift(); // Consume the closing double quote
return getToken(string, TokenType.String, line_cnt);
} else {
throw `SyntaxError:line:${line_cnt}: missing terminating ''' character.`;
}
}

return null;
}

Expand Down
12 changes: 2 additions & 10 deletions feat.avenger
Original file line number Diff line number Diff line change
@@ -1,10 +1,2 @@
# Old for loop
wakandaForEach(i in 10 to 20 step 2){
vision(i);
}
vision();

# New for loop
wakandaFor(newAvenger i = 0; i < 20; i = i + 1){
vision(i);
}
newAvenger string = '"HELLO WORLD!!!"';
vision(string);

0 comments on commit 3ace7b9

Please sign in to comment.