all: fix typos in comments (#20963)

This commit is contained in:
cui fliter 2024-03-05 00:41:55 +08:00 committed by GitHub
parent a58f980b02
commit 78602846e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 29 additions and 29 deletions

View file

@ -46,7 +46,7 @@
- [ ] Custom attributes - [ ] Custom attributes
- [ ] `arr.first() or { }` like `arr[0] or { }` - [ ] `arr.first() or { }` like `arr[0] or { }`
- [ ] ORM migrations - [ ] ORM migrations
- [ ] Contexts that are passed implicitely (e.g. for custom allocation/memory management) - [ ] Contexts that are passed implicitly (e.g. for custom allocation/memory management)
## [Version 1.0] ## [Version 1.0]

View file

@ -9,7 +9,7 @@ const win_height = 800
const bg_color = gx.white const bg_color = gx.white
// A transparent color is used to aid in verifying that // A transparent color is used to aid in verifying that
// rendering is precise on each of the the arc types (e.g. no overlapping or double rendered slices) // rendering is precise on each of the arc types (e.g. no overlapping or double rendered slices)
const colour = gx.rgba(100, 100, 0, 100) const colour = gx.rgba(100, 100, 0, 100)
enum Selection { enum Selection {

View file

@ -24,7 +24,7 @@ $ ./aStar
# Demo # Demo
![Demo image of the algorithm](screenshot.png) ![Demo image of the algorithm](screenshot.png)
# 🔴🔴🔴🔴 Area of improvments 🔴🔴🔴🔴🔴 # 🔴🔴🔴🔴 Area of improvements 🔴🔴🔴🔴🔴
- 🚧 Under Construction: We are using heap, but that is not correctly - 🚧 Under Construction: We are using heap, but that is not correctly
implemented, since instead of O(log(n)) it takes O(n). For that reason, implemented, since instead of O(log(n)) it takes O(n). For that reason,

View file

@ -86,7 +86,7 @@ fn main() {
init_fn: init_images // run at start of application init_fn: init_images // run at start of application
user_data: app // store user data user_data: app // store user data
) )
mut grid := initialise_grid() // initialize the grid varibale and populate the matrix with each cell as empty mut grid := initialise_grid() // initialize the grid variable and populate the matrix with each cell as empty
app.grid = grid // set grid to app attribute so you can access it by just passing app variable or with method of app app.grid = grid // set grid to app attribute so you can access it by just passing app variable or with method of app
app.ui.dpi_scale = 1.0 // set scale this is use to make it responsive app.ui.dpi_scale = 1.0 // set scale this is use to make it responsive
app.start = &Point{ // set start point to -1, -1 app.start = &Point{ // set start point to -1, -1

View file

@ -651,7 +651,7 @@ STBTT_DEF void stbtt_PackSetOversampling(stbtt_pack_context *spc, unsigned int h
STBTT_DEF void stbtt_PackSetSkipMissingCodepoints(stbtt_pack_context *spc, int skip); STBTT_DEF void stbtt_PackSetSkipMissingCodepoints(stbtt_pack_context *spc, int skip);
// If skip != 0, this tells stb_truetype to skip any codepoints for which // If skip != 0, this tells stb_truetype to skip any codepoints for which
// there is no corresponding glyph. If skip=0, which is the default, then // there is no corresponding glyph. If skip=0, which is the default, then
// codepoints without a glyph recived the font's "missing character" glyph, // codepoints without a glyph received the font's "missing character" glyph,
// typically an empty box by convention. // typically an empty box by convention.
STBTT_DEF void stbtt_GetPackedQuad(const stbtt_packedchar *chardata, int pw, int ph, // same data as above STBTT_DEF void stbtt_GetPackedQuad(const stbtt_packedchar *chardata, int pw, int ph, // same data as above

View file

@ -6592,7 +6592,7 @@ GC_INNER GC_bool GC_collection_in_progress(void);
/* Collection is in progress, or was abandoned. */ /* Collection is in progress, or was abandoned. */
/* Push contents of the symbol residing in the static roots area */ /* Push contents of the symbol residing in the static roots area */
/* excluded from scanning by the the collector for a reason. */ /* excluded from scanning by the collector for a reason. */
/* Note: it should be used only for symbols of relatively small size */ /* Note: it should be used only for symbols of relatively small size */
/* (one or several words). */ /* (one or several words). */
#define GC_PUSH_ALL_SYM(sym) GC_push_all_eager(&(sym), &(sym) + 1) #define GC_PUSH_ALL_SYM(sym) GC_push_all_eager(&(sym), &(sym) + 1)
@ -7917,7 +7917,7 @@ typedef struct {
/* to allow it to be distinguished from a free list */ /* to allow it to be distinguished from a free list */
/* link. This means the plain version must have the least */ /* link. This means the plain version must have the least */
/* significant bit of zero. Note that blocks dropped by */ /* significant bit of zero. Note that blocks dropped by */
/* black-listing will also have the the least significant */ /* black-listing will also have the least significant */
/* bit clear once debugging has started; we are careful */ /* bit clear once debugging has started; we are careful */
/* never to overwrite such a value. */ /* never to overwrite such a value. */
# if ALIGNMENT == 1 # if ALIGNMENT == 1

View file

@ -352,7 +352,7 @@ int mbedtls_asn1_write_octet_string( unsigned char **p, const unsigned char *sta
* the existing buffer to fit \p val_len. * the existing buffer to fit \p val_len.
* *
* \return A pointer to the new / existing entry on success. * \return A pointer to the new / existing entry on success.
* \return \c NULL if if there was a memory allocation error. * \return \c NULL if there was a memory allocation error.
*/ */
mbedtls_asn1_named_data *mbedtls_asn1_store_named_data( mbedtls_asn1_named_data **list, mbedtls_asn1_named_data *mbedtls_asn1_store_named_data( mbedtls_asn1_named_data **list,
const char *oid, size_t oid_len, const char *oid, size_t oid_len,

View file

@ -121,7 +121,7 @@ void mbedtls_debug_print_ret( const mbedtls_ssl_context *ssl, int level,
/* /*
* With non-blocking I/O and examples that just retry immediately, * With non-blocking I/O and examples that just retry immediately,
* the logs would be quickly flooded with WANT_READ, so ignore that. * the logs would be quickly flooded with WANT_READ, so ignore that.
* Don't ignore WANT_WRITE however, since is is usually rare. * Don't ignore WANT_WRITE however, since is usually rare.
*/ */
if( ret == MBEDTLS_ERR_SSL_WANT_READ ) if( ret == MBEDTLS_ERR_SSL_WANT_READ )
return; return;

View file

@ -732,7 +732,7 @@ static int ssl_prepare_client_hello( mbedtls_ssl_context *ssl )
/* /*
* Generate the random bytes, except when responding to a verify request * Generate the random bytes, except when responding to a verify request
* where we MUST reuse the previoulsy generated random bytes * where we MUST reuse the previously generated random bytes
* (RFC 6347 4.2.1). * (RFC 6347 4.2.1).
*/ */
#if defined(MBEDTLS_SSL_PROTO_DTLS) #if defined(MBEDTLS_SSL_PROTO_DTLS)

View file

@ -453,7 +453,7 @@
sgl_set_context(ctx); sgl_set_context(ctx);
The currently active context will implicitely be used by most sokol-gl functions The currently active context will implicitly be used by most sokol-gl functions
which don't take an explicit context handle as argument. which don't take an explicit context handle as argument.
To switch back to the default context, pass the global constant SGL_DEFAULT_CONTEXT: To switch back to the default context, pass the global constant SGL_DEFAULT_CONTEXT:

View file

@ -52,7 +52,7 @@ pub fn new_benchmark_pointer() &Benchmark {
} }
} }
// set_total_expected_steps sets the the total amount of steps the benchmark is expected to take. // set_total_expected_steps sets the total amount of steps the benchmark is expected to take.
pub fn (mut b Benchmark) set_total_expected_steps(n int) { pub fn (mut b Benchmark) set_total_expected_steps(n int) {
b.nexpected_steps = n b.nexpected_steps = n
} }

View file

@ -438,7 +438,7 @@ pub fn (mut s []string) sort_ignore_case() {
s.sort_with_compare(compare_lower_strings) s.sort_with_compare(compare_lower_strings)
} }
// sort_by_len sorts the the string array by each string's `.len` length. // sort_by_len sorts the string array by each string's `.len` length.
pub fn (mut s []string) sort_by_len() { pub fn (mut s []string) sort_by_len() {
s.sort_with_compare(compare_strings_by_len) s.sort_with_compare(compare_strings_by_len)
} }
@ -749,7 +749,7 @@ fn (s string) index_last_(p string) int {
return -1 return -1
} }
// index_last returns the position of the first character of the *last* occurance of the `needle` string in `s`. // index_last returns the position of the first character of the *last* occurrence of the `needle` string in `s`.
pub fn (s string) index_last(needle string) ?int { pub fn (s string) index_last(needle string) ?int {
idx := s.index_last_(needle) idx := s.index_last_(needle)
if idx == -1 { if idx == -1 {
@ -758,7 +758,7 @@ pub fn (s string) index_last(needle string) ?int {
return idx return idx
} }
// last_index returns the position of the first character of the *last* occurance of the `needle` string in `s`. // last_index returns the position of the first character of the *last* occurrence of the `needle` string in `s`.
@[deprecated: 'use `.index_last(needle string)` instead'] @[deprecated: 'use `.index_last(needle string)` instead']
@[deprecated_after: '2023-12-18'] @[deprecated_after: '2023-12-18']
@[inline] @[inline]

View file

@ -1205,7 +1205,7 @@ fn (s string) index_(p string) int {
return -1 return -1
} }
// index returns the position of the first character of the first occurance of the `needle` string in `s`. // index returns the position of the first character of the first occurrence of the `needle` string in `s`.
// It will return `none` if the `needle` string can't be found in `s`. // It will return `none` if the `needle` string can't be found in `s`.
pub fn (s string) index(p string) ?int { pub fn (s string) index(p string) ?int {
idx := s.index_(p) idx := s.index_(p)
@ -1215,7 +1215,7 @@ pub fn (s string) index(p string) ?int {
return idx return idx
} }
// index_last returns the position of the first character of the *last* occurance of the `needle` string in `s`. // index_last returns the position of the first character of the *last* occurrence of the `needle` string in `s`.
pub fn (s string) index_last(needle string) ?int { pub fn (s string) index_last(needle string) ?int {
idx := s.index_last_(needle) idx := s.index_last_(needle)
if idx == -1 { if idx == -1 {
@ -1224,7 +1224,7 @@ pub fn (s string) index_last(needle string) ?int {
return idx return idx
} }
// last_index returns the position of the first character of the *last* occurance of the `needle` string in `s`. // last_index returns the position of the first character of the *last* occurrence of the `needle` string in `s`.
@[deprecated: 'use `.index_last(needle string)` instead'] @[deprecated: 'use `.index_last(needle string)` instead']
@[deprecated_after: '2023-12-18'] @[deprecated_after: '2023-12-18']
@[inline] @[inline]
@ -1805,7 +1805,7 @@ pub fn (mut s []string) sort_ignore_case() {
s.sort_with_compare(compare_lower_strings) s.sort_with_compare(compare_lower_strings)
} }
// sort_by_len sorts the the string array by each string's `.len` length. // sort_by_len sorts the string array by each string's `.len` length.
@[inline] @[inline]
pub fn (mut s []string) sort_by_len() { pub fn (mut s []string) sort_by_len() {
s.sort_with_compare(compare_strings_by_len) s.sort_with_compare(compare_strings_by_len)

View file

@ -12,7 +12,7 @@ pub fn vwasm_heap_base() voidptr {
} }
// vwasm_heap_size returns the size of the main wasm memory in pages. // vwasm_heap_size returns the size of the main wasm memory in pages.
// Analagous to the `memory.size` instruction. // Analogous to the `memory.size` instruction.
pub fn vwasm_memory_size() int { pub fn vwasm_memory_size() int {
mut rval := 0 mut rval := 0
asm wasm { asm wasm {
@ -24,7 +24,7 @@ pub fn vwasm_memory_size() int {
} }
// vwasm_memory_grow grows the main wasm memory by `size` pages. // vwasm_memory_grow grows the main wasm memory by `size` pages.
// Analagous to the `memory.grow` instruction. // Analogous to the `memory.grow` instruction.
pub fn vwasm_memory_grow(size int) int { pub fn vwasm_memory_grow(size int) int {
mut rval := 0 mut rval := 0
asm wasm { asm wasm {

View file

@ -2,7 +2,7 @@ module stats
import math import math
// freq calculates the Measure of Occurance // freq calculates the Measure of Occurrence
// Frequency of a given number // Frequency of a given number
// Based on // Based on
// https://www.mathsisfun.com/data/frequency-distribution.html // https://www.mathsisfun.com/data/frequency-distribution.html

View file

@ -22,7 +22,7 @@ pub fn new() RE {
// init regex // init regex
mut re := RE{} mut re := RE{}
re.prog = []Token{len: max_code_len + 1} // max program length, can not be longer then the pattern re.prog = []Token{len: max_code_len + 1} // max program length, can not be longer then the pattern
re.cc = []CharClass{len: max_code_len} // can not be more char class the the length of the pattern re.cc = []CharClass{len: max_code_len} // can not be more char class the length of the pattern
re.group_csave_flag = false // enable continuos group saving re.group_csave_flag = false // enable continuos group saving
re.group_max_nested = 128 // set max 128 group nested re.group_max_nested = 128 // set max 128 group nested
re.group_max = max_code_len >> 1 // we can't have more groups than the half of the pattern legth re.group_max = max_code_len >> 1 // we can't have more groups than the half of the pattern legth
@ -38,7 +38,7 @@ pub fn regex_opt(pattern string) !RE {
// init regex // init regex
mut re := RE{} mut re := RE{}
re.prog = []Token{len: pattern.len + 1} // max program length, can not be longer then the pattern re.prog = []Token{len: pattern.len + 1} // max program length, can not be longer then the pattern
re.cc = []CharClass{len: pattern.len} // can not be more char class the the length of the pattern re.cc = []CharClass{len: pattern.len} // can not be more char class the length of the pattern
re.group_csave_flag = false // enable continuos group saving re.group_csave_flag = false // enable continuos group saving
re.group_max_nested = pattern.len >> 1 // set max 128 group nested re.group_max_nested = pattern.len >> 1 // set max 128 group nested
re.group_max = pattern.len >> 1 // we can't have more groups than the half of the pattern legth re.group_max = pattern.len >> 1 // we can't have more groups than the half of the pattern legth

View file

@ -20,7 +20,7 @@ pub fn regex_base(pattern string) (RE, int, int) {
// init regex // init regex
mut re := RE{} mut re := RE{}
re.prog = []Token{len: pattern.len + 1} // max program length, can not be longer then the pattern re.prog = []Token{len: pattern.len + 1} // max program length, can not be longer then the pattern
re.cc = []CharClass{len: pattern.len} // can not be more char class the the length of the pattern re.cc = []CharClass{len: pattern.len} // can not be more char class the length of the pattern
re.group_csave_flag = false // enable continuos group saving re.group_csave_flag = false // enable continuos group saving
re.group_max_nested = pattern.len >> 1 // set max 128 group nested re.group_max_nested = pattern.len >> 1 // set max 128 group nested
re.group_max = pattern.len >> 1 // we can't have more groups than the half of the pattern legth re.group_max = pattern.len >> 1 // we can't have more groups than the half of the pattern legth

View file

@ -776,7 +776,7 @@ pub enum Kind {
thread thread
} }
// str returns the the internal & source name of the type // str returns the internal & source name of the type
pub fn (t TypeSymbol) str() string { pub fn (t TypeSymbol) str() string {
return t.name return t.name
} }

View file

@ -2343,7 +2343,7 @@ fn (mut c Checker) hash_stmt(mut node ast.HashStmt) {
node.ct_conds = c.ct_cond_stack.clone() node.ct_conds = c.ct_cond_stack.clone()
} }
if c.pref.backend.is_js() || c.pref.backend == .golang { if c.pref.backend.is_js() || c.pref.backend == .golang {
// consider the the best way to handle the .go.vv files // consider the best way to handle the .go.vv files
if !c.file.path.ends_with('.js.v') && !c.file.path.ends_with('.go.v') if !c.file.path.ends_with('.js.v') && !c.file.path.ends_with('.go.v')
&& !c.file.path.ends_with('.go.vv') { && !c.file.path.ends_with('.go.vv') {
c.error('hash statements are only allowed in backend specific files such "x.js.v" and "x.go.v"', c.error('hash statements are only allowed in backend specific files such "x.js.v" and "x.go.v"',

View file

@ -408,7 +408,7 @@ fn (mut p Parser) expr(min_bp token.BindingPower) ast.Expr {
// to currently do this is to check for an ident where the name's first char is a capital, this is not // to currently do this is to check for an ident where the name's first char is a capital, this is not
// great at all, and would be the only place in the parser where a capital letter is relied upon, or even // great at all, and would be the only place in the parser where a capital letter is relied upon, or even
// the name at all is relied upon. imo this is context the parser should not need, and we should either // the name at all is relied upon. imo this is context the parser should not need, and we should either
// change the varibale capture syntax, or move the position of the capture list, for example: // change the variable capture syntax, or move the position of the capture list, for example:
// change syntax: `fn <var_a, var_b> [T] () { ... }`, move position: `fn [T] () { ... } [var_a, var_b]` // change syntax: `fn <var_a, var_b> [T] () { ... }`, move position: `fn [T] () { ... } [var_a, var_b]`
// personally I think `fn <var_a, var_b> [T] () { ... }` is a great option. // personally I think `fn <var_a, var_b> [T] () { ... }` is a great option.
mut captured_vars := []ast.Expr{} mut captured_vars := []ast.Expr{}

View file

@ -12,7 +12,7 @@ keep sending events to the client. But if we hold the connection open indefinite
vweb isn't able to process any other requests. vweb isn't able to process any other requests.
We can let vweb know that it can continue processing other requests and that we will We can let vweb know that it can continue processing other requests and that we will
handle the connection ourself by calling `ctx.takeover_conn()` and and returning an empty result handle the connection ourself by calling `ctx.takeover_conn()` and returning an empty result
with `vweb.no_result()`. Vweb will not close the connection and we can handle with `vweb.no_result()`. Vweb will not close the connection and we can handle
the connection in a separate thread. the connection in a separate thread.