33 |
} |
} |
34 |
), |
), |
35 |
q( |
q( |
36 |
if ($in =~ s/^\s*define\s+(\S+)\s*{\s*$//) { |
if ($in =~ s/^\s*define\s+([\w]+)(.*)$/$2/) { |
37 |
$atom->{type} = 'SECTION'; |
$atom->{type} = 'SECTION'; |
38 |
$atom->{section_name} = $1; |
$atom->{section_name} = $1; |
39 |
$atom->{sections} = [ ]; |
$atom->{sections} = [ ]; |
40 |
$out->{current_sections} = [ { name => $1 } ]; |
$out->{current_sections} = [ { name => $1 } ]; |
41 |
$matched = 1; |
$keep_atom = 1; |
42 |
|
$out->{line_continued} = 1; |
43 |
} |
} |
44 |
), |
), |
45 |
q( |
q( |
46 |
if ($in =~ s/^\s*\{\s*$// && $out->{line_continued}) { |
if ($out->{line_continued} && $in =~ s/^\s*\{\s*$//) { |
47 |
|
$out->{line_continued} = 0; |
48 |
$matched = 1; |
$matched = 1; |
49 |
|
$keep_atom = 0; |
50 |
} |
} |
51 |
), |
), |
52 |
q( |
q( |
53 |
if ($in =~ s/^\s*(.*?)(\s+?)\s*(.*)\s*$//) { |
if ($in =~ s/^\s*(\S+)\s+(.*)\s*$//) { |
54 |
$atom->{type} = 'KEY_VALUE'; |
$atom->{type} = 'KEY_VALUE'; |
55 |
$atom->{key} = $1; |
$atom->{key} = $1; |
56 |
$atom->{value} = [split(/\s*,\s*/, $3)]; |
$atom->{value} = [split(/\s*,\s*/, $2)]; |
57 |
$atom->{sections} = [ @{$out->{current_sections}} ]; |
$atom->{sections} = [ @{$out->{current_sections}} ]; |
58 |
$matched = 1; |
$matched = 1; |
59 |
} |
} |
60 |
) |
) |
61 |
], |
], |
62 |
comments => [ ['#'] ], |
comments => [ ['#'] ], |
|
comment_output => q(/^(\s*)$/ ? "$_\n" : "#$_\n"), |
|
63 |
output => { |
output => { |
64 |
KEY_VALUE => q( |
KEY_VALUE => q( |
65 |
my ($key, $value) = ($atom->{key}, join(', ', @{$atom->{value}})); |
my ($key, $value) = ($atom->{key}, join(', ', @{$atom->{value}})); |