bare: fix str[idx]

pull/2777/head
Alexander Medvednikov 2019-11-16 11:33:04 +03:00
parent a545ccb740
commit dc50ed69cf
2 changed files with 5 additions and 1 deletions

View File

@ -7,3 +7,7 @@ pub fn panic(s string) {
//write(1, s.str, s.len) //write(1, s.str, s.len)
} }
pub fn panic_debug(s string) {
//write(1, s.str, s.len)
}

View File

@ -211,7 +211,7 @@ fn (p mut Parser) index_get(typ string, fn_ph int, cfg IndexConfig) {
} }
} }
} }
else if cfg.is_str && !p.builtin_mod { else if cfg.is_str && !p.builtin_mod && !p.pref.is_bare {
if cfg.is_slice { if cfg.is_slice {
p.gen('string_substr2($index_expr)') p.gen('string_substr2($index_expr)')
} else { } else {