36 |
|
|
37 |
$templates{samba} = { |
$templates{samba} = { |
38 |
rules => [ q( |
rules => [ q( |
39 |
if ($in =~ s/^\s*(.*?)\s*=\s*(.*)\s*$//) { |
if ($in =~ s/^\s*(.*?)\s*=\s*(.*\S)\s*$//) { |
40 |
$atom->{type} = 'KEY_VALUE'; |
$atom->{type} = 'KEY_VALUE'; |
41 |
$atom->{key} = $1; |
$atom->{key} = $1; |
42 |
$atom->{value} = $2; |
$atom->{value} = $2; |
55 |
), |
), |
56 |
], |
], |
57 |
comments => [ [';'],['#']], |
comments => [ [';'],['#']], |
58 |
comment_output => q( |
# comment_output => q( |
59 |
my $indent = $INDENT_SPACES x $out->{current_indentation}; |
# my $indent = $INDENT_SPACES x $out->{current_indentation}; |
60 |
/^(\s*)$/ ? "$_\n" : "$indent;$_\n" |
# /^(\s*)$/ ? "$_\n" : "$indent;$_\n" |
61 |
), |
# ), |
62 |
output => { |
output => { |
63 |
KEY_VALUE => q( |
KEY_VALUE => q( |
64 |
my ($key, $value) = ($atom->{key}, $atom->{value}); |
my ($key, $value) = ($atom->{key}, $atom->{value}); |
65 |
return $INDENT_SPACES x $out->{current_indentation} . qq($key = $value\n); |
$output_indentation = $out->{current_indentation} ||= 1; |
66 |
|
$output_text = qq($key = $value); |
67 |
), |
), |
68 |
SECTION => q( |
SECTION => q( |
69 |
$out->{current_indentation} ||= 1; |
$output_indentation = 0; #sections are not indented |
70 |
return qq([$atom->{section_name}]\n); |
$output_text = qq([$atom->{section_name}]); #this is the output of the indentation |
71 |
|
$out->{current_indentation} = 1; #indentation for following atoms |
72 |
), |
), |
73 |
}, |
}, |
74 |
edit_atom => q( |
edit_atom => q( |