Skip to content

Commit

Permalink
docs: fix typos (#547)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandear committed May 10, 2024
1 parent cec2ad9 commit 6fed636
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions doc/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -3983,7 +3983,7 @@ See also: `string·codepoints`.
<a id='string·count'></a>
### 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).
Expand Down
4 changes: 2 additions & 2 deletions starlark/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
}
Expand Down
6 changes: 3 additions & 3 deletions starlark/value.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
//
Expand Down Expand Up @@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion syntax/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 6fed636

Please sign in to comment.