-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from zom-lang/parser-remake
Remake of the parser
- Loading branch information
Showing
36 changed files
with
2,709 additions
and
3,247 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,16 +1,28 @@ | ||
pub const test2 = 123 * 12 + 1; | ||
package hello.main | ||
|
||
fn fourteen(ptr: *const u8) u8 { | ||
const test1 = undefined; | ||
const test2 = 't'; | ||
var hello_world = "Hello world!".len; | ||
return a.*(12, 144); | ||
import std.fmt.println // <- NEW better import item! ;) | ||
import std.fmt as f | ||
|
||
fn add(a: u32,b: u32) u32 { | ||
var demo: u32 | ||
f.println("Hello world!") | ||
a, b = 123, 456 | ||
return a + b | ||
} | ||
|
||
extern "c" fn c_function() void; | ||
const test: u32 = 2 | ||
|
||
fn max(a: u32, b: u32) u32 { | ||
if (a > b) | ||
return a | ||
else | ||
return b | ||
// ^ a conditional stmt | ||
} | ||
|
||
extern "c" fn c_function2() void { | ||
// or with only one return stmt | ||
|
||
fn maxSimple(a: u32, b: u32) u32 { | ||
return a if a > b else b | ||
// ^ a conditional expression | ||
} | ||
|
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
Oops, something went wrong.