~bradclawsie/Lang-Go-Mod

2046cf89d01bc60bc65b1f9d016ce7fe715e7b90 — Brad Clawsie 3 years ago 5a2b063
align PR with perlcritic
3 files changed, 11 insertions(+), 4 deletions(-)

M Changelog
M lib/Lang/Go/Mod.pm
M t/samples/01/go.mod
M Changelog => Changelog +4 -0
@@ 6,3 6,7 @@

0.003 2021-07-29
  - Add some metadata for metacpan

0.004 2021-07-29
- Merge https://github.com/bradclawsie/Lang-Go-Mod/pull/1 for
  comment processing

M lib/Lang/Go/Mod.pm => lib/Lang/Go/Mod.pm +5 -4
@@ 13,7 13,7 @@ use Path::Tiny qw(path);

# ABSTRACT: parse and model go.mod files

our $VERSION   = '0.003';
our $VERSION   = '0.004';
our $AUTHORITY = 'cpan:bclawsie';

our @EXPORT_OK = qw(read_go_mod parse_go_mod);


@@ 121,11 121,11 @@ sub parse_go_mod {
              if ( defined $m->{'require'}->{$1} );
            $m->{'require'}->{$1} = $2;
        }
	elsif ( $line =~ m!^\s*//.*$! ) {
        elsif ( $line =~ m{^\s*//.*$}mx ) {

	    # comment
            # comment

	}
        }
        else {
            croak "unknown line content: $line";
        }


@@ 150,6 150,7 @@ C<Lang::Go::Mod> - parse and model go.mod files
   # $ cat go.mod
   # module github.com/example/my-project
   # go 1.16
   # // comments
   # exclude (
   #    example.com/whatmodule v1.4.0
   # )

M t/samples/01/go.mod => t/samples/01/go.mod +2 -0
@@ 2,6 2,8 @@ module github.com/example/my-project

go 1.16

// these are comments

exclude (
	example.com/whatmodule v1.4.0
)