diff --git a/vlib/cli/flag.v b/vlib/cli/flag.v index 1419353a74..dfd08602ab 100644 --- a/vlib/cli/flag.v +++ b/vlib/cli/flag.v @@ -211,7 +211,7 @@ pub fn (flags []Flag) get_strings(name string) ![]string { // parse parses flag values from arguments and return // an array of arguments with all consumed elements removed. -fn (mut flag Flag) parse(args []string, posix_mode bool) ![]string { +pub fn (mut flag Flag) parse(args []string, posix_mode bool) ![]string { if flag.matches(args, posix_mode) { if flag.flag == .bool { new_args := flag.parse_bool(args)! diff --git a/vlib/regex/regex.v b/vlib/regex/regex.v index 0990119643..ea939d2d29 100644 --- a/vlib/regex/regex.v +++ b/vlib/regex/regex.v @@ -321,7 +321,7 @@ pub mut: // Reset RE object [direct_array_access; inline] -fn (mut re RE) reset() { +pub fn (mut re RE) reset() { re.cc_index = 0 mut i := 0 diff --git a/vlib/toml/tests/encode_and_decode_test.v b/vlib/toml/tests/encode_and_decode_test.v index eb5151e07a..12ab0b6cbd 100644 --- a/vlib/toml/tests/encode_and_decode_test.v +++ b/vlib/toml/tests/encode_and_decode_test.v @@ -15,7 +15,7 @@ pub mut: title JobTitle } -fn (e Employee) to_toml() string { +pub fn (e Employee) to_toml() string { mut mp := map[string]toml.Any{} mp['name'] = toml.Any(e.name) mp['age'] = toml.Any(e.age) @@ -25,7 +25,7 @@ fn (e Employee) to_toml() string { return mp.to_toml() } -fn (mut e Employee) from_toml(any toml.Any) { +pub fn (mut e Employee) from_toml(any toml.Any) { mp := any.as_map() e.name = mp['name'] or { toml.Any('') }.string() e.age = mp['age'] or { toml.Any(0) }.int() diff --git a/vlib/v/ast/cflags.v b/vlib/v/ast/cflags.v index a1f7ba6b27..fac0a771a0 100644 --- a/vlib/v/ast/cflags.v +++ b/vlib/v/ast/cflags.v @@ -6,7 +6,7 @@ module ast import v.cflag // check if cflag is in table -fn (t &Table) has_cflag(flag cflag.CFlag) bool { +pub fn (t &Table) has_cflag(flag cflag.CFlag) bool { for cf in t.cflags { if cf.os == flag.os && cf.name == flag.name && cf.value == flag.value { return true diff --git a/vlib/v/checker/fn.v b/vlib/v/checker/fn.v index dcc1073bb5..059a664ac3 100644 --- a/vlib/v/checker/fn.v +++ b/vlib/v/checker/fn.v @@ -1502,7 +1502,7 @@ fn (mut c Checker) method_call(mut node ast.CallExpr) ast.Type { node.is_noreturn = method.is_noreturn node.is_ctor_new = method.is_ctor_new node.return_type = method.return_type - if !method.is_pub && !c.pref.is_test && method.mod != c.mod { + if !method.is_pub && method.mod != c.mod { // If a private method is called outside of the module // its receiver type is defined in, show an error. // println('warn $method_name lef.mod=$left_type_sym.mod c.mod=$c.mod') diff --git a/vlib/vweb/assets/assets.v b/vlib/vweb/assets/assets.v index 02197a66cb..de67ed6613 100644 --- a/vlib/vweb/assets/assets.v +++ b/vlib/vweb/assets/assets.v @@ -143,7 +143,7 @@ fn (am AssetManager) include(asset_type string, combine bool) string { // dont return option until size limit is removed // fn (mut am AssetManager) add(asset_type, file string) ?bool { -fn (mut am AssetManager) add(asset_type string, file string) bool { +pub fn (mut am AssetManager) add(asset_type string, file string) bool { if !os.exists(file) { // return error('vweb.assets: cannot add asset $file, it does not exist') return false diff --git a/vlib/x/json2/decoder.v b/vlib/x/json2/decoder.v index 494a4e5a0c..a3390bb865 100644 --- a/vlib/x/json2/decoder.v +++ b/vlib/x/json2/decoder.v @@ -113,7 +113,8 @@ fn new_parser(srce string, convert_type bool) Parser { } } -fn (mut p Parser) decode() !Any { +// decode decodes provided JSON +pub fn (mut p Parser) decode() !Any { p.next() p.next_with_err()! fi := p.decode_value()!