我正在尝试做:
the_tag= line[2..5]
rec_id_line = (line[2]=='@')? true : false
new_contents,new_to_close=
rec_id_line? open_id_tag(indent,line) : open_tag(indent,the_tag,last_field)
这两种方法都返回两个值(顺便说一句,我在这里重构)
即对于这两个变量,我要么想调用,open_id_tag(2 params)
否则open_tag(3 params)
取决于真/假 rec_id_line 值。