diff --git a/stdlib.slg b/stdlib.slg index 3cfd038..c3e922f 100644 --- a/stdlib.slg +++ b/stdlib.slg @@ -1,33 +1,54 @@ // stdlib.slg -fn exit(status_code: int) #[builtin(Exit)] {} +#[builtin(Exit)] +fn exit(status_code: int) {} -fn print(msg: string) #[builtin(Print)] {} -fn println(msg: string) { print(msg + "\n") } +#[builtin(Print)] +fn print(msg: string) {} +msg + "\n" +fn println(msg: string) { print) } -fn int_to_string(number: int) -> string #[builtin(IntToString)] {} +#[builtin(IntToString)] +fn int_to_string(number: int) -> string {} -fn string_push_char(str: string, value: int) -> string #[builtin(StringPushChar)] {} -fn string_char_at(str: string, index: int) -> int #[builtin(StringCharAt)] {} -fn string_length(str: string) -> int #[builtin(StringLength)] {} -fn string_to_int(str: string) -> int #[builtin(StringToInt)] {} +#[builtin(StringPushChar)] +fn string_push_char(str: string, value: int) -> string {} +#[builtin(StringCharAt)] +fn string_char_at(str: string, index: int) -> int {} +#[builtin(StringLength)] +fn string_length(str: string) -> int {} +#[builtin(StringToInt)] +fn string_to_int(str: string) -> int {} -fn array_new() -> [T] #[builtin(ArrayNew)] {} -fn array_push(array: [T], value: T) #[builtin(ArrayPush)] {} -fn array_length(array: [T]) -> int #[builtin(ArrayLength)] {} -fn array_at(array: [T], index: int) -> T #[builtin(ArrayAt)] {} +#[builtin(ArrayNew)] +fn array_new() -> [T] {} +#[builtin(ArrayPush)] +fn array_push(array: [T], value: T) {} +#[builtin(ArrayLength)] +fn array_length(array: [T]) -> int {} +#[builtin(ArrayAt)] +fn array_at(array: [T], index: int) -> T {} -fn file_open(filename: string, mode: string) -> int #[builtin(FileOpen)] {} -fn file_close(file: int) #[builtin(FileClose)] {} -fn file_write_string(file: int, content: string) -> int #[builtin(FileWriteString)] {} -fn file_read_char(file: int) -> int #[builtin(FileReadChar)] {} -fn file_read_to_string(file: int) -> string #[builtin(FileReadToString)] {} -fn file_flush(file: int) #[builtin(FileFlush)] {} -fn file_eof(file: int) -> bool #[builtin(FileEof)] {} +#[builtin(FileOpen)] +fn file_open(filename: string, mode: string) -> int {} +#[builtin(FileClose)] +fn file_close(file: int) {} +#[builtin(FileWriteString)] +fn file_write_string(file: int, content: string) -> int {} +#[builtin(FileReadChar)] +fn file_read_char(file: int) -> int {} +#[builtin(FileReadToString)] +fn file_read_to_string(file: int) -> string {} +#[builtin(FileFlush)] +fn file_flush(file: int) {} +#[builtin(FileEof)] +fn file_eof(file: int) -> bool {} -fn itos(number: int) -> string #[builtin(IntToString)] {} -fn stoi(str: string) -> int #[builtin(StringToInt)] {} +#[builtin(IntToString)] +fn itos(number: int) -> string {} +#[builtin(StringToInt)] +fn stoi(str: string) -> int {} fn stdin() -> int { 0 } fn stdout() -> int { 1 }