mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
docs: fix typos using codespell (#17332)
This commit is contained in:
@@ -13,7 +13,7 @@ This modules was port of Golang `edwards25519` library from [edwards25519](https
|
||||
About Edwards25519
|
||||
------------------
|
||||
|
||||
Twisted Edwards curves are a familly of elliptic curves allowing complete addition
|
||||
Twisted Edwards curves are a family of elliptic curves allowing complete addition
|
||||
formulas without any special case and no point at infinity.
|
||||
Curve edwards25519 is based on prime 2^255 - 19 for efficient implementation.
|
||||
Equation and parameters are given in RFC 7748.
|
||||
@@ -12,7 +12,7 @@ On each `run()`, all the possible transitions from the current state are evaluat
|
||||
The first transition for the current state, whose condition evaluates to true is
|
||||
taken (the condition is specified by a transition callback function).
|
||||
|
||||
In a successfull transition, the current state changes to the new one.
|
||||
In a successful transition, the current state changes to the new one.
|
||||
When that happens:
|
||||
* the client-specified `on_exit()` handler from the current state is called.
|
||||
* the client-specified `on_entry()` handler of the new state is called.
|
||||
|
||||
@@ -77,7 +77,7 @@ fn main() {
|
||||
|
||||
// the event handler
|
||||
fn on_error(receiver voidptr, e &Error, work &Work) {
|
||||
println('error occured on ${work.hours}. Error: ${e.message}')
|
||||
println('error occurred on ${work.hours}. Error: ${e.message}')
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ This is how to test the client:
|
||||
2. From the `local_run` folder, compile and run `autobahn_client.v` to test non ws (no TLS) and
|
||||
`autobahn_client_wss.v` to run the TLS tests
|
||||
3. Open `http://localhost:8080` and browse client test results for non TLS and `https://localhost:8081`
|
||||
if you ran the wss tests (it uses local certificat so you will get trust error but just accept use)
|
||||
if you ran the wss tests (it uses local certificate so you will get trust error but just accept use)
|
||||
|
||||
### Test the server
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ mut f := os.create('path/to/file') or {
|
||||
println("file not writable")
|
||||
}
|
||||
|
||||
// >> do someting with file; file is locked <<
|
||||
// >> do something with file; file is locked <<
|
||||
|
||||
f.close()
|
||||
```
|
||||
|
||||
@@ -114,5 +114,5 @@ A workaround (if you _must_ use the libc RNG) is to:
|
||||
[Math interval](<https://en.wikipedia.org/wiki/Interval_(mathematics)#Including_or_excluding_endpoints>)
|
||||
notation is used throughout the function documentation to denote what numbers ranges include.
|
||||
|
||||
An example of `[0, max)` thus denotes a range with all posible values
|
||||
An example of `[0, max)` thus denotes a range with all possible values
|
||||
between `0` and `max` **including** 0 but **excluding** `max`.
|
||||
|
||||
@@ -415,7 +415,7 @@ use a name map in the `re` struct, using the function `re.get_group_by_name`.
|
||||
|
||||
Here is a more complex example of using them:
|
||||
```v oksyntax
|
||||
// This function demostrate the use of the named groups
|
||||
// This function demonstrate the use of the named groups
|
||||
fn convert_html_rgb_n(in_col string) u32 {
|
||||
mut n_digit := if in_col.len == 4 { 1 } else { 2 }
|
||||
mut col_mul := if in_col.len == 4 { 4 } else { 0 }
|
||||
@@ -535,9 +535,9 @@ re.prog = []Token {len: pattern.len + 1}
|
||||
// can not be more char class the the length of the pattern
|
||||
re.cc = []CharClass{len: pattern.len}
|
||||
|
||||
re.group_csave_flag = false // true enable continuos group saving if needed
|
||||
re.group_csave_flag = false // true enable continuous group saving if needed
|
||||
re.group_max_nested = 128 // set max 128 group nested possible
|
||||
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 length
|
||||
re.group_stack = []int{len: re.group_max, init: -1}
|
||||
re.group_data = []int{len: re.group_max, init: -1}
|
||||
```
|
||||
@@ -618,7 +618,7 @@ pub fn (mut re RE) replace_simple(in_txt string, repl string) string
|
||||
|
||||
If it is needed to replace N instances of the found strings it is possible to use:
|
||||
```v ignore
|
||||
// replace_n return a string where the firts `count` matches are replaced with the repl_str string
|
||||
// replace_n return a string where the first `count` matches are replaced with the repl_str string
|
||||
// `count` indicate the number of max replacements that will be done.
|
||||
// if count is > 0 the replace began from the start of the string toward the end
|
||||
// if count is < 0 the replace began from the end of the string toward the start
|
||||
@@ -847,11 +847,11 @@ fn main(){
|
||||
// can not be more char class the the length of the query
|
||||
re.cc = []regex.CharClass{len: query.len}
|
||||
re.prog = []regex.Token {len: query.len+1}
|
||||
// enable continuos group saving
|
||||
// enable continuous group saving
|
||||
re.group_csave_flag = true
|
||||
// set max 128 group nested
|
||||
re.group_max_nested = 128
|
||||
// we can't have more groups than the half of the query legth
|
||||
// we can't have more groups than the half of the query length
|
||||
re.group_max = query.len>>1
|
||||
|
||||
// compile the query
|
||||
@@ -864,7 +864,7 @@ fn main(){
|
||||
println("No Match")
|
||||
}
|
||||
|
||||
// show results for continuos group saving
|
||||
// show results for continuous group saving
|
||||
if re.group_csave_flag == true && start >= 0 && re.group_csave.len > 0{
|
||||
println("cg: ${re.group_csave}")
|
||||
mut cs_i := 1
|
||||
|
||||
@@ -79,7 +79,7 @@ To query for a value that might not be in the document you
|
||||
can use the `.default_to(...)` function to provide a
|
||||
default value.
|
||||
|
||||
For cases where a default value might not be appropiate or
|
||||
For cases where a default value might not be appropriate or
|
||||
to check if a value exists you can use `doc.value_opt('query')!`
|
||||
instead.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
V allows for easily using text templates, expanded at compile time to
|
||||
V functions, that efficiently produce text output. This is especially
|
||||
usefull for templated HTML views, but the mechanism is general enough
|
||||
useful for templated HTML views, but the mechanism is general enough
|
||||
to be used for other kinds of text output also.
|
||||
|
||||
# Template directives
|
||||
|
||||
@@ -5,7 +5,7 @@ This module implements the `pkg-config` tool as a library in pure V.
|
||||
|
||||
Features:
|
||||
|
||||
* Simple API, but still not stable, but shouldnt change much
|
||||
* Simple API, but still not stable, but shouldn't change much
|
||||
* Runs 2x faster than original pkg-config
|
||||
* Commandline tool that aims to be compatible with `pkg-config`
|
||||
* Resolve full path for `.pc` file given a name
|
||||
@@ -16,7 +16,7 @@ Features:
|
||||
Todo/Future/Wish:
|
||||
|
||||
* 100% compatibility with `pkg-config` options
|
||||
* Strictier pc parsing logic, with better error reporting
|
||||
* Stricter pc parsing logic, with better error reporting
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
syntax - the tokens, as well as utilities for working with them.
|
||||
|
||||
## KeywordsMatcherTrie
|
||||
KeywordsMatcherTrie provides a faster way of determinining whether a given name is a reserved
|
||||
KeywordsMatcherTrie provides a faster way of determining whether a given name is a reserved
|
||||
word (belongs to a given set of previously known words `R`). It works by exploiting the fact,
|
||||
that the set of reserved words is small, and the words short.
|
||||
|
||||
|
||||
@@ -202,7 +202,7 @@ fn (mut app App) create_product() vweb.Result {
|
||||
|
||||
#### - Parameters
|
||||
|
||||
Parameters are passed direcly in endpoint route using colon sign `:` and received using the same
|
||||
Parameters are passed directly in endpoint route using colon sign `:` and received using the same
|
||||
name at function
|
||||
To pass a parameter to an endpoint, you simply define it inside an attribute, e. g.
|
||||
`['/hello/:user]`.
|
||||
@@ -628,7 +628,7 @@ fn (mut app App) index() vweb.Result {
|
||||
// Set a Csrf-Cookie (Token will be generated automatically)
|
||||
app.set_csrf_cookie()
|
||||
|
||||
// Get the token-value from the csrf-cookie that was just setted
|
||||
// Get the token-value from the csrf-cookie that was just set
|
||||
token := app.get_csrf_token() or { panic(err) }
|
||||
|
||||
return app.text("Csrf-Token set! It's value is: $token")
|
||||
|
||||
@@ -52,7 +52,7 @@ At high level no more action are required to use the loaded font.
|
||||
Multiple fonts can be loaded without problems at the same time.
|
||||
|
||||
## TTF Bitmap render
|
||||
In this modue it is possible to have different renders running at the same time.
|
||||
In this module it is possible to have different renders running at the same time.
|
||||
At the present time all the rendering are made on the CPU, sokol is used only to draw the
|
||||
rendered text to the screen.
|
||||
Let's start with a simple snippet of code:
|
||||
@@ -68,7 +68,7 @@ fn main() {
|
||||
println(ttf_font.get_info_string())
|
||||
}
|
||||
```
|
||||
This simple code load a TTF font and display its basic informations.
|
||||
This simple code load a TTF font and display its basic information.
|
||||
|
||||
### draw_text
|
||||
The draw text function draw simple strings without indentation or other imagination tasks.
|
||||
@@ -116,7 +116,7 @@ fn main() {
|
||||
bmp.save_as_ppm('test.ppm')
|
||||
}
|
||||
```
|
||||
This is the low level render that draw ther text on a bitmap and save the bitmap on a disk as
|
||||
This is the low level render that draw the text on a bitmap and save the bitmap on a disk as
|
||||
`.ppm` file.
|
||||
|
||||
> **Note**
|
||||
@@ -130,7 +130,7 @@ You can specify the style for the text rendering in the `BitMap` struct::
|
||||
enum Style {
|
||||
outline
|
||||
outline_aliased
|
||||
filled // default syle
|
||||
filled // default style
|
||||
raw
|
||||
}
|
||||
```
|
||||
@@ -191,16 +191,16 @@ This is the low level render that draw text block on the bitmap.
|
||||
A text block is defined from a `Text_block` struct:
|
||||
```v
|
||||
struct Text_block {
|
||||
x int // x postion of the left high corner
|
||||
y int // y postion of the left high corner
|
||||
x int // x position of the left high corner
|
||||
y int // y position of the left high corner
|
||||
w int // width of the text block
|
||||
h int // heigth of the text block
|
||||
h int // height of the text block
|
||||
cut_lines bool = true // force to cut the line if the length is over the text block width
|
||||
}
|
||||
```
|
||||
and use the following bitmap fields:
|
||||
```v ignore
|
||||
style Style = .filled // default syle
|
||||
style Style = .filled // default style
|
||||
align Text_align = .left // default text align
|
||||
justify bool // justify text flag, default deactivated
|
||||
justify_fill_ratio f32 = 0.5 // justify fill ratio, if the ratio of the filled
|
||||
|
||||
Reference in New Issue
Block a user