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

Commit

Permalink
Merge pull request #32 from SahilK-027/main
Browse files Browse the repository at this point in the history
This fixes #27
  • Loading branch information
shashankbhosagi authored Aug 7, 2023
2 parents d3787bf + 3ace7b9 commit 5074967
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 5074967

Please sign in to comment.