Gustavo Niemeyer před 13 roky
rodič
revize
65b1927d82
2 změnil soubory, kde provedl 10 přidání a 10 odebrání
  1. 4 4
      apic.go
  2. 6 6
      yamlprivateh.go

+ 4 - 4
apic.go

@@ -83,10 +83,10 @@ func yaml_parser_set_encoding(parser *yaml_parser_t, encoding yaml_encoding_t) {
 // Create a new emitter object.
 func yaml_emitter_initialize(emitter *yaml_emitter_t) bool {
 	*emitter = yaml_emitter_t{
-		buffer:         make([]byte, output_buffer_size),
-		raw_buffer:     make([]byte, 0, output_raw_buffer_size),
-		states:         make([]yaml_emitter_state_t, 0, initial_stack_size),
-		events:         make([]yaml_event_t, 0, initial_queue_size),
+		buffer:     make([]byte, output_buffer_size),
+		raw_buffer: make([]byte, 0, output_raw_buffer_size),
+		states:     make([]yaml_emitter_state_t, 0, initial_stack_size),
+		events:     make([]yaml_event_t, 0, initial_queue_size),
 	}
 	return true
 }

+ 6 - 6
yamlprivateh.go

@@ -114,8 +114,8 @@ func is_crlf(b []byte, i int) bool {
 // Check if the character is a line break or NUL.
 func is_breakz(b []byte, i int) bool {
 	//return is_break(b, i) || is_z(b, i)
-	return (// is_break:
-		b[i] == '\r' || // CR (#xD)
+	return (        // is_break:
+	b[i] == '\r' || // CR (#xD)
 		b[i] == '\n' || // LF (#xA)
 		b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85)
 		b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028)
@@ -127,8 +127,8 @@ func is_breakz(b []byte, i int) bool {
 // Check if the character is a line break, space, or NUL.
 func is_spacez(b []byte, i int) bool {
 	//return is_space(b, i) || is_breakz(b, i)
-	return (// is_space:
-		b[i] == ' ' ||
+	return ( // is_space:
+	b[i] == ' ' ||
 		// is_breakz:
 		b[i] == '\r' || // CR (#xD)
 		b[i] == '\n' || // LF (#xA)
@@ -141,8 +141,8 @@ func is_spacez(b []byte, i int) bool {
 // Check if the character is a line break, space, tab, or NUL.
 func is_blankz(b []byte, i int) bool {
 	//return is_blank(b, i) || is_breakz(b, i)
-	return (// is_blank:
-		b[i] == ' ' || b[i] == '\t' ||
+	return ( // is_blank:
+	b[i] == ' ' || b[i] == '\t' ||
 		// is_breakz:
 		b[i] == '\r' || // CR (#xD)
 		b[i] == '\n' || // LF (#xA)