add examples/hello.ry

This commit is contained in:
Luna 2019-09-18 11:37:08 -03:00
parent c46229154c
commit 53d41b31e7
2 changed files with 16 additions and 1 deletions

11
examples/hello.ry Normal file
View file

@ -0,0 +1,11 @@
import std;
fn add(a: i32, b: i32) i32 {
return a + b;
}
// type is void by default
fn main() {
std.fmt.print("piss\n");
// std.fmt.print("2 + 2 = %d\n", add(1, 2));
}

View file

@ -1,5 +1,9 @@
const std = @import("std"); const std = @import("std");
pub fn main() anyerror!void { pub fn main() anyerror!void {
std.debug.warn("All your base are belong to us.\n"); const allocator = std.heap.direct_allocator;
var args_it = std.process.args();
_ = args_it.skip();
const filepath = try (args_it.next(allocator) orelse @panic("expected file path"));
} }