@@ -319,13 +319,8 @@ fn process_toml(cargo_toml: &str, args: &Args) -> Result<String, String> {
319319 }
320320 } else if let Some ( ( dep, rest) ) = line. split_once ( "=" ) {
321321 let dep = dep. trim ( ) . trim_matches ( '"' ) ;
322- // Don't call `get_balanced` if we are not in features or a dependency table
323- let rest = if current_table == "features" || current_table. ends_with ( "dependencies" ) {
324- get_balanced ( rest, & mut lines)
325- . map_err ( |e| format ! ( "Parse error while parsing dependency {}: {}" , dep, e) ) ?
326- } else {
327- Cow :: from ( rest)
328- } ;
322+ let rest = get_balanced ( rest, & mut lines)
323+ . map_err ( |e| format ! ( "Parse error while parsing value {}: {}" , dep, e) ) ?;
329324 if current_table == "features" && dep == "default" {
330325 let defaults = rest
331326 . trim ( )
@@ -424,6 +419,7 @@ fn get_balanced<'a>(
424419 }
425420 } else {
426421 match b {
422+ b'\\' => last_slash = true ,
427423 b'"' => in_quote = true ,
428424 b'{' | b'[' => level += 1 ,
429425 b'}' | b']' if level == 0 => return Err ( "unbalanced source" . into ( ) ) ,
@@ -666,7 +662,7 @@ default = [
666662#ffff
667663# ff
668664"# ,
669- "Parse error while parsing dependency default" ,
665+ "Parse error while parsing value default" ,
670666 ) ;
671667 }
672668
@@ -679,7 +675,7 @@ default = [
679675foo = [ x = { ]
680676bar = []
681677"# ,
682- "Parse error while parsing dependency foo" ,
678+ "Parse error while parsing value foo" ,
683679 ) ;
684680 }
685681
@@ -802,6 +798,14 @@ optional = true
802798 #[ test]
803799 fn multi_lines ( ) {
804800 let toml = r#"
801+ [package.metadata.foo]
802+ ixyz = [
803+ ["array"],
804+ [
805+ "of",
806+ "arrays"
807+ ]
808+ ]
805809[dev-dependencies]
806810## dep1
807811dep1 = {
0 commit comments