40 |
$atom->{type} = 'KEY_VALUE'; |
$atom->{type} = 'KEY_VALUE'; |
41 |
$atom->{key} = $1; |
$atom->{key} = $1; |
42 |
$atom->{value} = $2; |
$atom->{value} = $2; |
43 |
$out->{current_section} and $atom->{sections} = [ $out->{current_section} ]; |
$atom->{sections} = [ @{$out->{current_sections}} ]; |
44 |
$matched = 1; |
$matched = 1; |
45 |
} |
} |
46 |
), |
), |
48 |
if ($in =~ s/^\s*\[([^\]]+)\]\s*$//) { |
if ($in =~ s/^\s*\[([^\]]+)\]\s*$//) { |
49 |
$atom->{type} = 'SECTION'; |
$atom->{type} = 'SECTION'; |
50 |
$atom->{section_name} = $1; |
$atom->{section_name} = $1; |
51 |
$out->{current_section} = { name => $1 }; |
$atom->{sections} = [ ]; |
52 |
|
$out->{current_sections} = [ { name => $1 } ]; |
53 |
$matched = 1; |
$matched = 1; |
54 |
} |
} |
55 |
), |
), |
65 |
return $INDENT_SPACES x $out->{current_indentation} . qq($key = $value\n); |
return $INDENT_SPACES x $out->{current_indentation} . qq($key = $value\n); |
66 |
), |
), |
67 |
SECTION => q( |
SECTION => q( |
68 |
my $indent = $INDENT_SPACES x ($out->{current_indentation} ||= 1); |
$out->{current_indentation} ||= 1; |
69 |
return $indent . qq([$atom->{section_name}]\n); |
return qq([$atom->{section_name}]\n); |
70 |
), |
), |
71 |
}, |
}, |
72 |
edit_atom => q( |
edit_atom => q( |