From 2ff82be95aff05bf2ad7bdeeb8c14bd84a930ef1 Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Mon, 13 Jan 2025 23:42:43 +0100 Subject: [PATCH] chore: fix various typos & add typos.yml CI Signed-off-by: Adam Perkowski --- .github/workflows/typos.yml | 17 +++++++++++++++++ src/julec/obj/cxx/object.jule | 8 ++++---- src/julec/obj/cxx/scope.jule | 10 +++++----- src/julec/opt/expr.jule | 2 +- src/julec/opt/scope.jule | 2 +- std/bufio/scan.jule | 2 +- std/encoding/json/decode.jule | 4 ++-- std/encoding/json/decode_test.jule | 16 ++++++++-------- std/encoding/json/encode.jule | 2 +- std/encoding/json/encode_test.jule | 16 ++++++++-------- std/internal/poll/fd_unix.jule | 6 +++--- std/internal/poll/fd_windows.jule | 10 +++++----- std/jule/README.md | 4 ++-- std/jule/importer/importer.jule | 4 ++-- std/jule/sema/sema.jule | 2 +- std/jule/sema/struct.jule | 2 +- std/net/tcp_conn.jule | 6 +++--- std/net/udp_conn.jule | 6 +++--- std/os/file_unix.jule | 6 +++--- std/os/file_windows.jule | 6 +++--- std/runtime/chan.jule | 2 +- std/runtime/io.jule | 2 +- std/runtime/map.jule | 2 +- std/runtime/maphash.jule | 2 +- std/runtime/strconv.jule | 6 +++--- std/sync/waitgroup.jule | 2 +- std/sys/syscall_windows.jule | 8 ++++---- 27 files changed, 86 insertions(+), 69 deletions(-) create mode 100644 .github/workflows/typos.yml diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml new file mode 100644 index 000000000..61130f1d7 --- /dev/null +++ b/.github/workflows/typos.yml @@ -0,0 +1,17 @@ +name: Check typos + +on: + push: + branches: ["master"] + pull_request: + workflow_dispatch: + +jobs: + check-typos: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Run spellcheck + uses: crate-ci/typos@master diff --git a/src/julec/obj/cxx/object.jule b/src/julec/obj/cxx/object.jule index ee2cd6f58..86e74bf1d 100644 --- a/src/julec/obj/cxx/object.jule +++ b/src/julec/obj/cxx/object.jule @@ -710,7 +710,7 @@ impl ObjectCoder { self.indent() self.write("return ") self.addIndent() - mut writed := false + mut written := false // Common model for custom expressions. mut lmodel := "_self_->" @@ -722,10 +722,10 @@ impl ObjectCoder { if strct != nil && strct.Decl != nil && strct.Decl.Binded { continue } - if writed { + if written { self.write(" &&") } - writed = true + written = true self.write("\n") self.indent() @@ -739,7 +739,7 @@ impl ObjectCoder { rmodel = rmodel[:len(rmodel)-fIdent.Len()] } self.doneIndent() - if !writed { + if !written { self.write("true") } self.write(";\n") diff --git a/src/julec/obj/cxx/scope.jule b/src/julec/obj/cxx/scope.jule index 68c80838d..25f7ddd94 100644 --- a/src/julec/obj/cxx/scope.jule +++ b/src/julec/obj/cxx/scope.jule @@ -452,19 +452,19 @@ impl scopeCoder { } fn conditional(mut &self, mut c: &sema::Conditional) { - mut writed := false + mut written := false for (_, mut elif) in c.Elifs { if elif == nil { continue } - if writed { + if written { self.oc.write(" else ") } - writed = true + written = true self.ifCase(elif) } if c.Default != nil { - if writed { + if written { self.oc.write(" else ") } self.scope(c.Default.Scope) @@ -1371,7 +1371,7 @@ impl scopeCoder { } } } else if len(f.Decl.Result.Idents) == 1 { - // Non-tuple signle return type with identifier. + // Non-tuple single return type with identifier. // Use [resultName] as identifier. self.oc.indent() self.oc.tc.kind(self.oc.Buf, f.Result) diff --git a/src/julec/opt/expr.jule b/src/julec/opt/expr.jule index a63e13665..a0a161340 100644 --- a/src/julec/opt/expr.jule +++ b/src/julec/opt/expr.jule @@ -394,7 +394,7 @@ impl exprOptimizer { // Tries optimize binary expression for neutral elements. // Specialized in math optimizations. fn tryNeutralElement(self, mut &m: &sema::BinaryExpr): bool { - // For netural element optimization, one of the operands should be constant. + // For neutral element optimization, one of the operands should be constant. match type m.Left.Model { | &constant::Const: mut c := (&constant::Const)(m.Left.Model) diff --git a/src/julec/opt/scope.jule b/src/julec/opt/scope.jule index 6ac7005c7..d456922df 100644 --- a/src/julec/opt/scope.jule +++ b/src/julec/opt/scope.jule @@ -815,7 +815,7 @@ impl scopeOptimizer { // Expressions will be more simple, so analysis may have optimization chance. self.normalizeAssign(assign, tup) - // Split assignments as a signle assignment if possible. + // Split assignments as a single assignment if possible. // Because multi-assign expressions use temporary values. // So, remove temporary variables using single assignments if possible. self.splitAssign(assign, tup) diff --git a/std/bufio/scan.jule b/std/bufio/scan.jule index 5559a497a..0fd263c6a 100644 --- a/std/bufio/scan.jule +++ b/std/bufio/scan.jule @@ -100,7 +100,7 @@ struct Scanner { start: int // First non-processed byte in buf. end: int // End of data in buf. empties: int // Count of successive empty tokens. - mut tok: []byte // The last readed token. + mut tok: []byte // The last read token. } impl Scanner { diff --git a/std/encoding/json/decode.jule b/std/encoding/json/decode.jule index 32dacfb28..60dafb7ed 100644 --- a/std/encoding/json/decode.jule +++ b/std/encoding/json/decode.jule @@ -142,7 +142,7 @@ impl jsonDecoder { ret lit } - // Scans inputs quicky, not checks validity. + // Scans inputs efficiently, not checks validity. // Only checks for length. fn scanLit(self)!: []byte { i := self.i @@ -436,7 +436,7 @@ impl jsonDecoder { // Tries to use custom decoding method if exist for supported types. // Reports whether it found and decoded successfully. // Forwards any exception, all exceptionals are forwarded. - // So, any exception means custom decode method found and it throwed exception. + // So, any exception means custom decode method found and it threw exception. fn tryCustomDecode[T](self, mut &t: T)!: bool { const tt = comptime::TypeOf(T) const match { diff --git a/std/encoding/json/decode_test.jule b/std/encoding/json/decode_test.jule index 0f7189896..7d38b66a7 100644 --- a/std/encoding/json/decode_test.jule +++ b/std/encoding/json/decode_test.jule @@ -220,7 +220,7 @@ fn testCustomDecode(t: &testing::T) { mut b := []byte("false") mut a := new(abc, -1) Decode(b, a) else { - t.Errorf("want 0, throwed exception") + t.Errorf("want 0, threw exception") *a = 0 } if *a != 0 { @@ -229,7 +229,7 @@ fn testCustomDecode(t: &testing::T) { *a = -1 b = []byte("true") Decode(b, a) else { - t.Errorf("want 1, throwed exception") + t.Errorf("want 1, threw exception") *a = 1 } if *a != 1 { @@ -242,7 +242,7 @@ fn testCustomDecode1(t: &testing::T) { mut b := []byte("false") mut a := abc(-1) Decode(b, a) else { - t.Errorf("want 0, throwed exception") + t.Errorf("want 0, threw exception") a = 0 } if a != 0 { @@ -251,7 +251,7 @@ fn testCustomDecode1(t: &testing::T) { a = -1 b = []byte("true") Decode(b, a) else { - t.Errorf("want 1, throwed exception") + t.Errorf("want 1, threw exception") a = 1 } if a != 1 { @@ -264,7 +264,7 @@ fn testCustomDecode2(t: &testing::T) { mut b := []byte("false") mut a := abc2(new(int, -1)) Decode(b, a) else { - t.Errorf("want 0, throwed exception") + t.Errorf("want 0, threw exception") *a = 0 } if *a != 0 { @@ -273,7 +273,7 @@ fn testCustomDecode2(t: &testing::T) { *a = -1 b = []byte("true") Decode(b, a) else { - t.Errorf("want 1, throwed exception") + t.Errorf("want 1, threw exception") *a = 1 } if *a != 1 { @@ -286,7 +286,7 @@ fn testCustomDecode3(t: &testing::T) { mut b := []byte("false") mut a := new(abc2, new(int, -1)) Decode(b, a) else { - t.Errorf("want 0, throwed exception") + t.Errorf("want 0, threw exception") **a = 0 } if **a != 0 { @@ -295,7 +295,7 @@ fn testCustomDecode3(t: &testing::T) { **a = -1 b = []byte("true") Decode(b, a) else { - t.Errorf("want 1, throwed exception") + t.Errorf("want 1, threw exception") **a = 1 } if **a != 1 { diff --git a/std/encoding/json/encode.jule b/std/encoding/json/encode.jule index 61e3fb049..994bb05e9 100644 --- a/std/encoding/json/encode.jule +++ b/std/encoding/json/encode.jule @@ -408,7 +408,7 @@ impl jsonEncoder { | comptime::Kind.SmartPtr: // Avoid to implement as a function. // Fills call stack faster especially with recursive structures. - // Handle smart pointers here quicky and forward to relevant encoder. + // Handle smart pointers here efficiently and forward to relevant encoder. if t == nil { self.encodeNil() } else { diff --git a/std/encoding/json/encode_test.jule b/std/encoding/json/encode_test.jule index 01b8b3df0..b68cb9826 100644 --- a/std/encoding/json/encode_test.jule +++ b/std/encoding/json/encode_test.jule @@ -326,7 +326,7 @@ impl abc { fn testCustomEncode(t: &testing::T) { mut a := new(abc, 0) mut r := Encode(a) else { - t.Errorf("want false, throwed exception") + t.Errorf("want false, threw exception") use []byte("false") } if str(r) != "false" { @@ -334,7 +334,7 @@ fn testCustomEncode(t: &testing::T) { } *a = 1 r = Encode(a) else { - t.Errorf("want true, throwed exception") + t.Errorf("want true, threw exception") use []byte("true") } if str(r) != "true" { @@ -346,7 +346,7 @@ fn testCustomEncode(t: &testing::T) { fn testCustomEncode1(t: &testing::T) { mut a := abc(0) mut r := Encode(a) else { - t.Errorf("want false, throwed exception") + t.Errorf("want false, threw exception") use []byte("false") } if str(r) != "false" { @@ -354,7 +354,7 @@ fn testCustomEncode1(t: &testing::T) { } a = 1 r = Encode(a) else { - t.Errorf("want true, throwed exception") + t.Errorf("want true, threw exception") use []byte("true") } if str(r) != "true" { @@ -390,7 +390,7 @@ impl abc2 { fn testCustomEncode2(t: &testing::T) { mut a := abc2(new(int, 0)) mut r := Encode(a) else { - t.Errorf("want false, throwed exception") + t.Errorf("want false, threw exception") use []byte("false") } if str(r) != "false" { @@ -398,7 +398,7 @@ fn testCustomEncode2(t: &testing::T) { } *a = 1 r = Encode(a) else { - t.Errorf("want true, throwed exception") + t.Errorf("want true, threw exception") use []byte("true") } if str(r) != "true" { @@ -410,7 +410,7 @@ fn testCustomEncode2(t: &testing::T) { fn testCustomEncode3(t: &testing::T) { mut a := new(abc2, new(int, 0)) mut r := Encode(a) else { - t.Errorf("want false, throwed exception") + t.Errorf("want false, threw exception") use []byte("false") } if str(r) != "false" { @@ -418,7 +418,7 @@ fn testCustomEncode3(t: &testing::T) { } **a = 1 r = Encode(a) else { - t.Errorf("want true, throwed exception") + t.Errorf("want true, threw exception") use []byte("true") } if str(r) != "true" { diff --git a/std/internal/poll/fd_unix.jule b/std/internal/poll/fd_unix.jule index 75e5e812b..2b8d4c85c 100644 --- a/std/internal/poll/fd_unix.jule +++ b/std/internal/poll/fd_unix.jule @@ -24,7 +24,7 @@ struct FD { } impl FD { - // Writes bytes to the file descriptor and returns writed byte count. + // Writes bytes to the file descriptor and returns written byte count. // The number of bytes written can never exceed the length of the buf. fn Write(mut self, buf: []byte): (n: int, ok: bool) { if len(buf) == 0 { @@ -84,8 +84,8 @@ impl FD { ret } - // Read bytes to buffer from the file descriptor and returns readed byte count. - // The number of bytes readed can never exceed the length of the buf. + // Read bytes to buffer from the file descriptor and returns read byte count. + // The number of bytes read can never exceed the length of the buf. // If the buf is larger than the number of bytes that can be read, // the buffer will not cause an overflow. Offset will be shifted // by the number of bytes read. diff --git a/std/internal/poll/fd_windows.jule b/std/internal/poll/fd_windows.jule index 94211abf4..b9a92e991 100644 --- a/std/internal/poll/fd_windows.jule +++ b/std/internal/poll/fd_windows.jule @@ -31,7 +31,7 @@ struct FD { } impl FD { - // Writes bytes to the file descriptor and returns writed byte count. + // Writes bytes to the file descriptor and returns written byte count. // The number of bytes written can never exceed the length of the buf. fn Write(mut self, buf: []byte): (n: int, ok: bool) { if len(buf) == 0 { @@ -99,7 +99,7 @@ impl FD { ret } - // Writes buf to console handle, returns writed byte count. + // Writes buf to console handle, returns written byte count. // Returns -1 if error occurred. fn writeConsole(mut self, mut buf: []byte): (n: int) { n = len(buf) @@ -143,8 +143,8 @@ impl FD { ret } - // Read bytes to buffer from the file descriptor and returns readed byte count. - // The number of bytes readed can never exceed the length of the buf. + // Read bytes to buffer from the file descriptor and returns read byte count. + // The number of bytes read can never exceed the length of the buf. // If the buf is larger than the number of bytes that can be read, // the buffer will not cause an overflow. Offset will be shifted // by the number of bytes read. @@ -197,7 +197,7 @@ impl FD { ret } - // Reads from console handle into buf to console handle, returns readed byte count. + // Reads from console handle into buf to console handle, returns read byte count. fn readConsole(mut self, mut buf: []byte): (n: int, ok: bool) { if self.readu16 == nil { // This information adopted from the Go programming language: diff --git a/std/jule/README.md b/std/jule/README.md index 15f62975f..88816c966 100644 --- a/std/jule/README.md +++ b/std/jule/README.md @@ -49,7 +49,7 @@ For example: \ These packages are specially processed and treated differently than standard use declarations. These treatments only apply to supported packages. To see relevant treatments, see implicit imports section of the reference.\ \ -Typical uses are things like capturing or tracing private behavior. For example, the reference Jule compiler may embed the `std/runtime` package for some special calls. The semantic analyzer makes the necessary private calls for this embedded package when necessary. For example, appends instance to array compare generic method for array comparions. +Typical uses are things like capturing or tracing private behavior. For example, the reference Jule compiler may embed the `std/runtime` package for some special calls. The semantic analyzer makes the necessary private calls for this embedded package when necessary. For example, appends instance to array compare generic method for array comparison. - **(8.1)** The `Token` field is used to distinguish specific packages. If the `Token` field of the AST element is set to `nil`, the package built-in use declaration is considered. Accordingly, AST must always set the `Token` field for each use declaration which is not implicitly imported. - **(8.2)** Semantic analyzer will ignore implicit use declaration for duplication analysis. So, built-in implicit imported packages may be duplicated if placed source file contains separate use declaration for the same package. - **(8.3)** These packages should be placed as first use declarations of the main package's first file. @@ -74,4 +74,4 @@ Here is the list of custom behaviors for this package; - (1) `arrayCmp`: Developed to eliminate the need for the Jule compiler to generate code specifically for array comparisons for each backend and to reduce analysis cost. The semantic analyzer creates the necessary instance for this generic function when an array comparison is made. Thus, the necessary comparison function for each array is programmed at the Jule frontend level. - (2): `toStr`: Built-in string conversion function for types. An instance is created in any situation that may be required. - (3): `_Map`: Built-in map type implementation. An instance created for each unique map type declaration. -- (4): `pchan`: Built-in chan type implementation. An instance created for each unique channel type declaration. \ No newline at end of file +- (4): `pchan`: Built-in chan type implementation. An instance created for each unique channel type declaration. diff --git a/std/jule/importer/importer.jule b/std/jule/importer/importer.jule index 776085db4..2ca164cfd 100644 --- a/std/jule/importer/importer.jule +++ b/std/jule/importer/importer.jule @@ -73,7 +73,7 @@ impl sema::Importer for Importer { fn GetImport(mut self, path: str): &sema::ImportInfo { for (_, mut p) in self.pkgs { - // avoid case sensivity for fair comparison + // avoid case sensitivity for fair comparison if strings::EqualFold(p.Path, path) { ret p } @@ -141,7 +141,7 @@ impl sema::Importer for Importer { fn Imported(mut self, mut imp: &sema::ImportInfo) { // Already imported? for _, p in self.pkgs { - // avoid case sensivity for fair comparison + // avoid case sensitivity for fair comparison if p.Binded == imp.Binded && strings::EqualFold(p.Path, imp.Path) { ret } diff --git a/std/jule/sema/sema.jule b/std/jule/sema/sema.jule index 1587ee332..fee9fcce5 100644 --- a/std/jule/sema/sema.jule +++ b/std/jule/sema/sema.jule @@ -375,7 +375,7 @@ impl sema { // The public and token parameters belongs to define which is accessed. fn isAccessibleDefine(self, public: bool, token: &token::Token): bool { if public || token.File == nil { - // defins is public or built-in + // public or built-in ret true } selfDir := self.file.File.Dir() diff --git a/std/jule/sema/struct.jule b/std/jule/sema/struct.jule index fc1810752..203c153ad 100644 --- a/std/jule/sema/struct.jule +++ b/std/jule/sema/struct.jule @@ -119,7 +119,7 @@ impl Struct { } // Appends instance if unique. - // Returns already exist instance if given insance is not unique. + // Returns already exist instance if given instance is not unique. fn appendInstance(mut self, mut &ins: &StructIns): &StructIns { // Skip already created instance for just one unique combination. if len(self.Generics) == 0 && len(self.Instances) == 1 { diff --git a/std/net/tcp_conn.jule b/std/net/tcp_conn.jule index 1573b84c3..aae58952d 100644 --- a/std/net/tcp_conn.jule +++ b/std/net/tcp_conn.jule @@ -23,8 +23,8 @@ impl io::Stream for TCPConn {} impl io::WriteCloser for TCPConn {} impl TCPConn { - // Read bytes to buffer from connection and returns readed byte count. - // The number of bytes readed can never exceed the length of the buffer. + // Read bytes to buffer from connection and returns read byte count. + // The number of bytes read can never exceed the length of the buffer. // If the buffer is larger than the number of bytes that can be read, // the buffer will not cause an overflow. // It will panic if connection is closed. @@ -49,7 +49,7 @@ impl TCPConn { error(lastErrorCode()) } - // Writes bytes to connection and returns writed byte count. + // Writes bytes to connection and returns written byte count. // The number of bytes written can never exceed the length of the buffer. // All exceptionals are error code of implementation. fn Write(mut self, buf: []byte)!: int { diff --git a/std/net/udp_conn.jule b/std/net/udp_conn.jule index 11bf37093..7731a36f8 100644 --- a/std/net/udp_conn.jule +++ b/std/net/udp_conn.jule @@ -45,8 +45,8 @@ impl UDPConn { ret udpDial(Network.UDP, addr) else { error(error) } } - // Read bytes to buffer from connection and returns readed byte count. - // The number of bytes readed can never exceed the length of the buffer. + // Read bytes to buffer from connection and returns read byte count. + // The number of bytes read can never exceed the length of the buffer. // If the buffer is larger than the number of bytes that can be read, // the buffer will not cause an overflow. // It will panic if connection is closed. @@ -67,7 +67,7 @@ impl UDPConn { error(lastErrorCode()) } - // Writes bytes to connection and returns writed byte count. + // Writes bytes to connection and returns written byte count. // The number of bytes written can never exceed the length of the buffer. // All exceptionals are error code of implementation. fn Write(mut self, buf: []byte)!: (n: int) { diff --git a/std/os/file_unix.jule b/std/os/file_unix.jule index c8a6d3ee8..91142121f 100644 --- a/std/os/file_unix.jule +++ b/std/os/file_unix.jule @@ -32,7 +32,7 @@ impl File { } impl File { - // Writes bytes to handle and returns writed byte count. + // Writes bytes to handle and returns written byte count. // The number of bytes written can never exceed the length of the buf. // // Implements the io::Writer trait. @@ -44,8 +44,8 @@ impl File { ret } - // Read bytes to buffer from handle and returns readed byte count. - // The number of bytes readed can never exceed the length of the buf. + // Read bytes to buffer from handle and returns read byte count. + // The number of bytes read can never exceed the length of the buf. // If the buf is larger than the number of bytes that can be read, // the buffer will not cause an overflow. Offset will be shifted // by the number of bytes read. diff --git a/std/os/file_windows.jule b/std/os/file_windows.jule index 01fcbf976..0cdb42968 100644 --- a/std/os/file_windows.jule +++ b/std/os/file_windows.jule @@ -34,7 +34,7 @@ impl File { } impl File { - // Writes bytes to handle and returns writed byte count. + // Writes bytes to handle and returns written byte count. // The number of bytes written can never exceed the length of the buf. // // Implements the io::Writer trait. @@ -49,8 +49,8 @@ impl File { ret } - // Read bytes to buffer from handle and returns readed byte count. - // The number of bytes readed can never exceed the length of the buf. + // Read bytes to buffer from handle and returns read byte count. + // The number of bytes read can never exceed the length of the buf. // If the buf is larger than the number of bytes that can be read, // the buffer will not cause an overflow. Offset will be shifted // by the number of bytes read. diff --git a/std/runtime/chan.jule b/std/runtime/chan.jule index 49ae53a54..46b7542db 100644 --- a/std/runtime/chan.jule +++ b/std/runtime/chan.jule @@ -202,7 +202,7 @@ impl pchan { // Since the channel is no longer fully functional, set the buffer // to nil. This drops references to the relevant allocations without // waiting for the channel to go out of scope, making it easier - // to gain used memory back quicky. Helps to reduce memory consumption. + // to gain used memory back efficiently. Helps to reduce memory consumption. self.queue.buf = nil self.queue.data = nil self.lock.unlock() diff --git a/std/runtime/io.jule b/std/runtime/io.jule index 7530effea..cc92f4170 100644 --- a/std/runtime/io.jule +++ b/std/runtime/io.jule @@ -33,7 +33,7 @@ fn writeStderr(buf: []byte): int { } // Reads from stdin. -// Returns readed byte count if success, -1 otherwise. +// Returns read byte count if success, -1 otherwise. #export "__jule_readStdin" fn readStdin(mut buf: []byte): int { mut n, ok := stdin.Read(buf) diff --git a/std/runtime/map.jule b/std/runtime/map.jule index 3712d8c03..9d77a3ec2 100644 --- a/std/runtime/map.jule +++ b/std/runtime/map.jule @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD 3-Clause // license that can be found in the LICENSE file. -// This file constains the source code of the built-in map type. +// This file contains the source code of the built-in map type. // The built-in map type implementation is typically a hashmap. // It is not lock-free in terms of concurrency, that is, // it does not offer a thread-safe implementation. diff --git a/std/runtime/maphash.jule b/std/runtime/maphash.jule index a3ab4d813..abac46d59 100644 --- a/std/runtime/maphash.jule +++ b/std/runtime/maphash.jule @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD 3-Clause // license that can be found in the LICENSE file. -// This file constains the source code of the built-in map type's hasher. +// This file contains the source code of the built-in map type's hasher. // This is basically 128-bit CityHash hash algorithm, converted to 64-bit after. // The implementation adopted from the original Go code: https://github.com/zentures/cityhash/blob/master/cityhash.go, commit [cdd6a94]. // Comes with this license text: diff --git a/std/runtime/strconv.jule b/std/runtime/strconv.jule index d5160bae9..1cc5fe6ac 100644 --- a/std/runtime/strconv.jule +++ b/std/runtime/strconv.jule @@ -172,12 +172,12 @@ fn arrToStr[T](x: T): str { fn mapToStr[T](x: T): str { mut buf := make([]byte, 0, 20) buf = append(buf, '{') - mut writed := false + mut written := false for key, val in x { - if writed { + if written { buf = append(buf, ", "...) } else { - writed = true + written = true } buf = append(buf, toStr(key)...) buf = append(buf, ':') diff --git a/std/sync/waitgroup.jule b/std/sync/waitgroup.jule index 9f6b1b10e..577be11e4 100644 --- a/std/sync/waitgroup.jule +++ b/std/sync/waitgroup.jule @@ -79,7 +79,7 @@ impl WaitGroup { if self.state.CompareAndSwap(state, state+1, atomic::SeqCst) { runtime::semacquire(self.sema, false, runtime::semaWaitGroup) if self.state.Load(atomic::SeqCst) != 0 { - panic("std/sync: WaitGroup is resused before previous Wait has returned") + panic("std/sync: WaitGroup is reused before previous Wait has returned") } ret } diff --git a/std/sys/syscall_windows.jule b/std/sys/syscall_windows.jule index b72f2d899..438493c6e 100644 --- a/std/sys/syscall_windows.jule +++ b/std/sys/syscall_windows.jule @@ -44,7 +44,7 @@ cpp unsafe fn SetConsoleMode(handle: cpp.HANDLE, mode: cpp.DWORD): bool cpp unsafe fn WriteConsoleW(handle: cpp.HANDLE, buffer: *unsafe, toWrite: cpp.DWORD, written: *cpp.DWORD, reserved: *unsafe): bool cpp unsafe fn ReadConsoleW(handle: cpp.HANDLE, mut buffer: *unsafe, - toRead: cpp.DWORD, readed: *cpp.DWORD, inputControl: *unsafe): bool + toRead: cpp.DWORD, read: *cpp.DWORD, inputControl: *unsafe): bool cpp fn WSAGetLastError(): int cpp unsafe fn FindFirstFileW(*integ::Wchar, *cpp.WIN32_FIND_DATAW): cpp.HANDLE cpp unsafe fn FindNextFileW(cpp.HANDLE, *cpp.WIN32_FIND_DATAW): int @@ -80,7 +80,7 @@ unsafe fn Wopen(path: *u16, flag: int, mode: int): int { // Returns last Windows error. fn GetLastError(): u32 { ret cpp.GetLastError() } -// Reads working directory into buff and returns readed +// Reads working directory into buff and returns read // rune count of current process. Returns 0 if fail. unsafe fn GetCurrentDirectory(bufflen: u32, mut buff: *u16): u32 { ret cpp.GetCurrentDirectoryW(bufflen, (*integ::Wchar)(buff)) @@ -133,9 +133,9 @@ unsafe fn WriteConsole(handle: Handle, buffer: *u16, toWrite: u32, // Calls Windows's ReadConsoleW function. // Passes nil pointer for input control. unsafe fn ReadConsole(handle: Handle, mut buffer: *u16, toRead: u32, - mut &readed: u32): bool { + mut &read: u32): bool { ret cpp.ReadConsoleW(cpp.HANDLE(handle), (*unsafe)(buffer), - cpp.DWORD(toRead), (*cpp.DWORD)(&readed), nil) + cpp.DWORD(toRead), (*cpp.DWORD)(&read), nil) } // Calls Windows's WSAGetLastError function.