Просмотр исходного кода

Drop invalid simple key assertion.

Reported as part of #323.

Previously dropped in libyaml itself with
https://github.com/yaml/libyaml/commit/9465961
Gustavo Niemeyer 8 лет назад
Родитель
Сommit
04092268b2
1 измененных файлов с 0 добавлено и 6 удалено
  1. 0 6
      scannerc.go

+ 0 - 6
scannerc.go

@@ -871,12 +871,6 @@ func yaml_parser_save_simple_key(parser *yaml_parser_t) bool {
 
 
 	required := parser.flow_level == 0 && parser.indent == parser.mark.column
 	required := parser.flow_level == 0 && parser.indent == parser.mark.column
 
 
-	// A simple key is required only when it is the first token in the current
-	// line.  Therefore it is always allowed.  But we add a check anyway.
-	if required && !parser.simple_key_allowed {
-		panic("should not happen")
-	}
-
 	//
 	//
 	// If the current position may start a simple key, save it.
 	// If the current position may start a simple key, save it.
 	//
 	//