/[libconf]/libconf/perl-Libconf/templates/samba_template.pm
ViewVC logotype

Diff of /libconf/perl-Libconf/templates/samba_template.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by dams, Sun May 25 12:41:09 2003 UTC revision 1.7 by dams, Thu May 29 18:08:17 2003 UTC
# Line 36  package Libconf; Line 36  package Libconf;
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;
# Line 55  $templates{samba} = { Line 55  $templates{samba} = {
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(

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26