mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
string: make left/right private
This commit is contained in:
@ -214,7 +214,7 @@ fn (p mut Parser) fn_decl() {
|
||||
is_public: is_pub || p.is_vh // functions defined in .vh are always public
|
||||
is_unsafe: p.attr == 'unsafe_fn'
|
||||
is_deprecated: p.attr == 'deprecated'
|
||||
comptime_define: if p.attr.starts_with('if ') { p.attr.right(3) } else { '' }
|
||||
comptime_define: if p.attr.starts_with('if ') { p.attr[3..] } else { '' }
|
||||
}
|
||||
is_live := p.attr == 'live' && !p.pref.is_so && p.pref.is_live
|
||||
if p.attr == 'live' && p.first_pass() && !p.pref.is_live && !p.pref.is_so {
|
||||
|
@ -983,11 +983,11 @@ fn (p mut Parser) get_type() string {
|
||||
p.check(.amp)
|
||||
}
|
||||
// generic type check
|
||||
ti := p.cur_fn.dispatch_of.inst
|
||||
if p.lit in ti.keys() {
|
||||
ti := p.cur_fn.dispatch_of.inst
|
||||
if p.lit in ti.keys() {
|
||||
typ += ti[p.lit]
|
||||
} else {
|
||||
typ += p.lit
|
||||
} else {
|
||||
typ += p.lit
|
||||
}
|
||||
// C.Struct import
|
||||
if p.lit == 'C' && p.peek() == .dot {
|
||||
@ -2093,7 +2093,7 @@ fn (p mut Parser) index_expr(typ_ string, fn_ph int) string {
|
||||
// }
|
||||
if is_indexer {
|
||||
l := p.cgen.cur_line.trim_space()
|
||||
index_val := l.right(l.last_index(' ')).trim_space()
|
||||
index_val := l[l.last_index(' ')..].trim_space()
|
||||
p.cgen.resetln(l[..fn_ph])
|
||||
p.table.varg_access << VargAccess{
|
||||
fn_name: p.cur_fn.name,
|
||||
|
Reference in New Issue
Block a user