(emitter *yaml_emitter_t, comment []byte)
| 1983 | } |
| 1984 | |
| 1985 | func yaml_emitter_write_comment(emitter *yaml_emitter_t, comment []byte) bool { |
| 1986 | breaks := false |
| 1987 | pound := false |
| 1988 | for i := 0; i < len(comment); { |
| 1989 | if is_break(comment, i) { |
| 1990 | if !write_break(emitter, comment, &i) { |
| 1991 | return false |
| 1992 | } |
| 1993 | //emitter.indention = true |
| 1994 | breaks = true |
| 1995 | pound = false |
| 1996 | } else { |
| 1997 | if breaks && !yaml_emitter_write_indent(emitter) { |
| 1998 | return false |
| 1999 | } |
| 2000 | if !pound { |
| 2001 | if comment[i] != '#' && (!put(emitter, '#') || !put(emitter, ' ')) { |
| 2002 | return false |
| 2003 | } |
| 2004 | pound = true |
| 2005 | } |
| 2006 | if !write(emitter, comment, &i) { |
| 2007 | return false |
| 2008 | } |
| 2009 | emitter.indention = false |
| 2010 | breaks = false |
| 2011 | } |
| 2012 | } |
| 2013 | if !breaks && !put_break(emitter) { |
| 2014 | return false |
| 2015 | } |
| 2016 | |
| 2017 | emitter.whitespace = true |
| 2018 | //emitter.indention = true |
| 2019 | return true |
| 2020 | } |
no test coverage detected