From 1c8c3a109d8bce733afeb1a8561d24c687806287 Mon Sep 17 00:00:00 2001 From: Jordan Bonecutter <34787245+jordan-bonecutter@users.noreply.github.com> Date: Sun, 24 Jan 2021 01:15:11 -0800 Subject: [PATCH] examples: fix typos/grammar and chmod u+x v_script.vsh (#8304) --- examples/binary_search_tree.v | 2 +- examples/regex_example.v | 14 +++++++------- examples/v_script.vsh | 0 3 files changed, 8 insertions(+), 8 deletions(-) mode change 100644 => 100755 examples/v_script.vsh diff --git a/examples/binary_search_tree.v b/examples/binary_search_tree.v index 64015f59c8..5b7dc24f34 100644 --- a/examples/binary_search_tree.v +++ b/examples/binary_search_tree.v @@ -62,7 +62,7 @@ fn min(tree Tree) f64 { } } -// delete a value in BST (if nonexist do nothing) +// delete a value in BST (if nonexistant do nothing) fn delete(tree Tree, x f64) Tree { match tree { Empty { return tree } diff --git a/examples/regex_example.v b/examples/regex_example.v index 29a2e6816c..25d322db8f 100644 --- a/examples/regex_example.v +++ b/examples/regex_example.v @@ -11,17 +11,17 @@ import regex /* -This simple function convert an HTML RGB value with 3 or 6 hex digits to an u32 value, -this function is not optimized and it si only for didatical purpose +This simple function converts an HTML RGB value with 3 or 6 hex digits to a u32 value, +this function is not optimized and it is only for didatical purpose example: #A0B0CC #A9F */ fn convert_html_rgb(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 } - // this is the regex query, it use the V string interpolation to customize the regex query + // this is the regex query, it uses V string interpolation to customize the regex query // NOTE: if you want use escaped code you must use the r"" (raw) strings, - // *** please remember that the V interpoaltion doesn't work on raw strings. *** + // *** please remember that V interpoaltion doesn't work on raw strings. *** query:= "#([a-fA-F0-9]{$n_digit})([a-fA-F0-9]{$n_digit})([a-fA-F0-9]{$n_digit})" @@ -41,7 +41,7 @@ fn convert_html_rgb(in_col string) u32 { } /* -This function demostrate the use of the named groups +This function demonstrates 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 } @@ -70,11 +70,11 @@ fn convert_html_rgb_n(in_col string) u32 { } fn main() { - // convert HTML rgb color usign groups + // convert HTML rgb color using groups println(convert_html_rgb("#A0b0Cc").hex()) println(convert_html_rgb("#ABC").hex()) - // convert HTML rgb color using maned groups + // convert HTML rgb color using named groups println(convert_html_rgb_n("#A0B0CC").hex()) println(convert_html_rgb_n("#ABC").hex()) } diff --git a/examples/v_script.vsh b/examples/v_script.vsh old mode 100644 new mode 100755