Commit cfaced3f73

Andrew Kelley <superjoe30@gmail.com>
2016-09-05 23:03:11
rename errName builtin to errorName
1 parent 768a978
Changed files (5)
example
cat
guess_number
src
std
test
example/cat/main.zig
@@ -17,7 +17,7 @@ pub fn main(args: [][]u8) -> %void {
             var is: io.InStream = undefined;
             is.open(arg) %% |err| {
                 %%io.stderr.printf("Unable to open file: ");
-                %%io.stderr.printf(@errName(err));
+                %%io.stderr.printf(@errorName(err));
                 %%io.stderr.printf("\n");
                 return err;
             };
@@ -46,7 +46,7 @@ fn cat_stream(is: io.InStream) -> %void {
     while (true) {
         const bytes_read = is.read(buf) %% |err| {
             %%io.stderr.printf("Unable to read from stream: ");
-            %%io.stderr.printf(@errName(err));
+            %%io.stderr.printf(@errorName(err));
             %%io.stderr.printf("\n");
             return err;
         };
@@ -57,7 +57,7 @@ fn cat_stream(is: io.InStream) -> %void {
 
         io.stdout.write(buf[0...bytes_read]) %% |err| {
             %%io.stderr.printf("Unable to write to stdout: ");
-            %%io.stderr.printf(@errName(err));
+            %%io.stderr.printf(@errorName(err));
             %%io.stderr.printf("\n");
             return err;
         };
example/guess_number/main.zig
@@ -19,7 +19,7 @@ pub fn main(args: [][]u8) -> %void {
 
         const line_len = io.stdin.read(line_buf) %% |err| {
             %%io.stdout.printf("Unable to read from stdin: ");
-            %%io.stdout.printf(@errName(err));
+            %%io.stdout.printf(@errorName(err));
             %%io.stdout.printf("\n");
             return err;
         };
src/codegen.cpp
@@ -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, BuiltinFnIdImport, "import", 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, BuiltinFnIdCmpExchange, "cmpxchg", 5);
     create_builtin_fn_with_arg_count(g, BuiltinFnIdFence, "fence", 1);
std/mem.zig
@@ -19,7 +19,7 @@ pub struct Allocator {
         alloc(self, T, n) %% |err| {
             // TODO var args printf
             %%io.stderr.write("allocation failure: ");
-            %%io.stderr.write(@errName(err));
+            %%io.stderr.write(@errorName(err));
             %%io.stderr.printf("\n");
             os.abort()
         }
test/self_hosted.zig
@@ -766,8 +766,8 @@ error AnError;
 error ALongerErrorName;
 #attribute("test")
 fn errorNameString() {
-    assert(str.eql(@errName(error.AnError), "AnError"));
-    assert(str.eql(@errName(error.ALongerErrorName), "ALongerErrorName"));
+    assert(str.eql(@errorName(error.AnError), "AnError"));
+    assert(str.eql(@errorName(error.ALongerErrorName), "ALongerErrorName"));
 }