From 6fed6365a1243f68755d8d929be060a7e734368f Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Fri, 10 May 2024 18:44:28 +0300 Subject: [PATCH] docs: fix typos (#547) --- doc/spec.md | 6 +++--- starlark/profile.go | 4 ++-- starlark/value.go | 6 +++--- syntax/parse.go | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/spec.md b/doc/spec.md index d6427e11..51d097c0 100644 --- a/doc/spec.md +++ b/doc/spec.md @@ -1160,7 +1160,7 @@ A function call completes normally after the execution of either a `return` statement, or of the last statement in the function body. The result of the function call is the value of the return statement's operand, or `None` if the return statement had no operand or if the -function completeted without executing a return statement. +function completed without executing a return statement. ```python def f(x): @@ -1345,7 +1345,7 @@ x = "hello" The same is also true for nested loops in comprehensions. In the (unnatural) examples below, the scope of the variables `x`, `y`, -and `z` is the entire compehension block, except the operand of the first +and `z` is the entire comprehension block, except the operand of the first loop (`[]` or `[1]`), which is resolved in the enclosing environment. The second loop may thus refer to variables defined by the third (`z`), even though such references would fail if actually executed. @@ -3983,7 +3983,7 @@ See also: `string·codepoints`. ### string·count -`S.count(sub[, start[, end]])` returns the number of occcurences of +`S.count(sub[, start[, end]])` returns the number of occurrences of `sub` within the string S, or, if the optional substring indices `start` and `end` are provided, within the designated substring of S. They are interpreted according to Starlark's [indexing conventions](#indexing). diff --git a/starlark/profile.go b/starlark/profile.go index 590a4e2b..364f30ca 100644 --- a/starlark/profile.go +++ b/starlark/profile.go @@ -22,7 +22,7 @@ package starlark // stack and sends it to the profiler goroutine, along with the number // of quanta, which are subtracted. For example, if the accumulator // holds 3ms and then a completed span adds 25ms to it, its value is 28ms, -// which exceeeds 10ms. The profiler records a stack with the value 20ms +// which exceeds 10ms. The profiler records a stack with the value 20ms // (2 quanta), and the accumulator is left with 8ms. // // The profiler goroutine converts the stacks into the pprof format and @@ -391,7 +391,7 @@ func profFuncAddr(fn Callable) uintptr { } // User-defined callable types are typically of - // of kind pointer-to-struct. Handle them specially. + // kind pointer-to-struct. Handle them specially. if v := reflect.ValueOf(fn); v.Type().Kind() == reflect.Ptr { return v.Pointer() } diff --git a/starlark/value.go b/starlark/value.go index 94e200ab..d0a9bb35 100644 --- a/starlark/value.go +++ b/starlark/value.go @@ -535,7 +535,7 @@ func (f Float) Unary(op syntax.Token) (Value, error) { // String is the type of a Starlark text string. // -// A String encapsulates an an immutable sequence of bytes, +// A String encapsulates an immutable sequence of bytes, // but strings are not directly iterable. Instead, iterate // over the result of calling one of these four methods: // codepoints, codepoint_ords, elems, elem_ords. @@ -1624,7 +1624,7 @@ func Iterate(x Value) Iterator { // // for elem := range Elements(iterable) { ... } // -// Push iterators are provided as a convience for Go client code. The +// Push iterators are provided as a convenience for Go client code. The // core iteration behavior of Starlark for-loops is defined by the // [Iterable] interface. // @@ -1654,7 +1654,7 @@ func Elements(iterable Iterable) func(yield func(Value) bool) { // // for k, v := range Entries(mapping) { ... } // -// Push iterators are provided as a convience for Go client code. The +// Push iterators are provided as a convenience for Go client code. The // core iteration behavior of Starlark for-loops is defined by the // [Iterable] interface. // diff --git a/syntax/parse.go b/syntax/parse.go index 1cce4428..215e20d9 100644 --- a/syntax/parse.go +++ b/syntax/parse.go @@ -562,7 +562,7 @@ func (p *parser) parseTest() Expr { return x } -// parseTestNoCond parses a a single-component expression without +// parseTestNoCond parses a single-component expression without // consuming a trailing 'if expr else expr'. func (p *parser) parseTestNoCond() Expr { if p.tok == LAMBDA {