diff -ur v4/ezyaml.py v5/ezyaml.py --- v4/ezyaml.py 2018-08-31 02:40:11.000000000 +0900 +++ v5/ezyaml.py 2018-08-31 05:15:00.000000000 +0900 @@ -93,6 +93,9 @@ if v == None: if lines: v = get_dict_v(idt, lines) + elif type(v) == str: + v += get_cont_str(idt+2, lines) + dic = { k: v } if lines: s = lines[0] @@ -135,8 +138,23 @@ s = s[1:-1] return s +def get_cont_str(idt, lines): + if lines: + s = lines[0] + (idt_, kind_) = get_idt_kind(s) + if kind_ == 'other' and idt_ == idt: # ! + v = get_value( s[idt:] ) + typ = type(v) + if ( typ == str and v ) or ( typ in (int, float) ): + s = lines.pop(0)[idt:] + return ' ' + s + get_cont_str(idt, lines) + return '' + def get_other(idt, lines): - return get_value( lines.pop(0)[idt:] ) + v = get_value( lines.pop(0)[idt:] ) + if type(v) == str: + v += get_cont_str(idt+2, lines) + return v def get(idt, kind, lines): if kind == 'dict':