-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor parser and lexer: update token handling for maps, enhance er…
…ror reporting, and add support for new syntax features
- Loading branch information
Showing
30 changed files
with
8,163 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//Arrays are simple to create and are dynamic. Which means you can add or remove elements from an array at any time. | ||
//Arrays are created using square brackets [] along with the type of the elements in the array. for example: []Type | ||
let oneDArray : []i32 = [1, 2, 3]; | ||
//you can also remove the type as it can be inferred from the elements in the array | ||
let twoDArray := [[1, 2], [3, 4]]; | ||
//you can also create an empty array and add elements to it later. But you need to specify the type of the elements in the array | ||
let emptyArray : []i32; | ||
emptyArray = [1, 2, 3]; | ||
|
||
//Indexing an array is done using square brackets [] with the index of the element you want to access | ||
let firstElement := oneDArray[0]; //firstElement is 1 of type i32 | ||
let otherElement := twoDArray[1][0]; //otherElement is 3 of type i32 | ||
//you can also change the value of an element in an array using the index | ||
oneDArray[0] = 5; |
Oops, something went wrong.