rename errName builtin to errorName
This commit is contained in:
parent
768a9780ca
commit
cfaced3f73
@ -17,7 +17,7 @@ pub fn main(args: [][]u8) -> %void {
|
|||||||
var is: io.InStream = undefined;
|
var is: io.InStream = undefined;
|
||||||
is.open(arg) %% |err| {
|
is.open(arg) %% |err| {
|
||||||
%%io.stderr.printf("Unable to open file: ");
|
%%io.stderr.printf("Unable to open file: ");
|
||||||
%%io.stderr.printf(@errName(err));
|
%%io.stderr.printf(@errorName(err));
|
||||||
%%io.stderr.printf("\n");
|
%%io.stderr.printf("\n");
|
||||||
return err;
|
return err;
|
||||||
};
|
};
|
||||||
@ -46,7 +46,7 @@ fn cat_stream(is: io.InStream) -> %void {
|
|||||||
while (true) {
|
while (true) {
|
||||||
const bytes_read = is.read(buf) %% |err| {
|
const bytes_read = is.read(buf) %% |err| {
|
||||||
%%io.stderr.printf("Unable to read from stream: ");
|
%%io.stderr.printf("Unable to read from stream: ");
|
||||||
%%io.stderr.printf(@errName(err));
|
%%io.stderr.printf(@errorName(err));
|
||||||
%%io.stderr.printf("\n");
|
%%io.stderr.printf("\n");
|
||||||
return err;
|
return err;
|
||||||
};
|
};
|
||||||
@ -57,7 +57,7 @@ fn cat_stream(is: io.InStream) -> %void {
|
|||||||
|
|
||||||
io.stdout.write(buf[0...bytes_read]) %% |err| {
|
io.stdout.write(buf[0...bytes_read]) %% |err| {
|
||||||
%%io.stderr.printf("Unable to write to stdout: ");
|
%%io.stderr.printf("Unable to write to stdout: ");
|
||||||
%%io.stderr.printf(@errName(err));
|
%%io.stderr.printf(@errorName(err));
|
||||||
%%io.stderr.printf("\n");
|
%%io.stderr.printf("\n");
|
||||||
return err;
|
return err;
|
||||||
};
|
};
|
||||||
|
@ -19,7 +19,7 @@ pub fn main(args: [][]u8) -> %void {
|
|||||||
|
|
||||||
const line_len = io.stdin.read(line_buf) %% |err| {
|
const line_len = io.stdin.read(line_buf) %% |err| {
|
||||||
%%io.stdout.printf("Unable to read from stdin: ");
|
%%io.stdout.printf("Unable to read from stdin: ");
|
||||||
%%io.stdout.printf(@errName(err));
|
%%io.stdout.printf(@errorName(err));
|
||||||
%%io.stdout.printf("\n");
|
%%io.stdout.printf("\n");
|
||||||
return err;
|
return err;
|
||||||
};
|
};
|
||||||
|
@ -4843,7 +4843,7 @@ static void define_builtin_fns(CodeGen *g) {
|
|||||||
create_builtin_fn_with_arg_count(g, BuiltinFnIdClz, "clz", 2);
|
create_builtin_fn_with_arg_count(g, BuiltinFnIdClz, "clz", 2);
|
||||||
create_builtin_fn_with_arg_count(g, BuiltinFnIdImport, "import", 1);
|
create_builtin_fn_with_arg_count(g, BuiltinFnIdImport, "import", 1);
|
||||||
create_builtin_fn_with_arg_count(g, BuiltinFnIdCImport, "cImport", 1);
|
create_builtin_fn_with_arg_count(g, BuiltinFnIdCImport, "cImport", 1);
|
||||||
create_builtin_fn_with_arg_count(g, BuiltinFnIdErrName, "errName", 1);
|
create_builtin_fn_with_arg_count(g, BuiltinFnIdErrName, "errorName", 1);
|
||||||
create_builtin_fn_with_arg_count(g, BuiltinFnIdEmbedFile, "embedFile", 1);
|
create_builtin_fn_with_arg_count(g, BuiltinFnIdEmbedFile, "embedFile", 1);
|
||||||
create_builtin_fn_with_arg_count(g, BuiltinFnIdCmpExchange, "cmpxchg", 5);
|
create_builtin_fn_with_arg_count(g, BuiltinFnIdCmpExchange, "cmpxchg", 5);
|
||||||
create_builtin_fn_with_arg_count(g, BuiltinFnIdFence, "fence", 1);
|
create_builtin_fn_with_arg_count(g, BuiltinFnIdFence, "fence", 1);
|
||||||
|
@ -19,7 +19,7 @@ pub struct Allocator {
|
|||||||
alloc(self, T, n) %% |err| {
|
alloc(self, T, n) %% |err| {
|
||||||
// TODO var args printf
|
// TODO var args printf
|
||||||
%%io.stderr.write("allocation failure: ");
|
%%io.stderr.write("allocation failure: ");
|
||||||
%%io.stderr.write(@errName(err));
|
%%io.stderr.write(@errorName(err));
|
||||||
%%io.stderr.printf("\n");
|
%%io.stderr.printf("\n");
|
||||||
os.abort()
|
os.abort()
|
||||||
}
|
}
|
||||||
|
@ -766,8 +766,8 @@ error AnError;
|
|||||||
error ALongerErrorName;
|
error ALongerErrorName;
|
||||||
#attribute("test")
|
#attribute("test")
|
||||||
fn errorNameString() {
|
fn errorNameString() {
|
||||||
assert(str.eql(@errName(error.AnError), "AnError"));
|
assert(str.eql(@errorName(error.AnError), "AnError"));
|
||||||
assert(str.eql(@errName(error.ALongerErrorName), "ALongerErrorName"));
|
assert(str.eql(@errorName(error.ALongerErrorName), "ALongerErrorName"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user