| 1 | package App::mkpkgconfig::PkgConfig::Entry; | ||
| 2 | |||
| 3 | 5 | ▶ | use v5.14; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 5 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 5 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | # ABSTRACT: Base class for PkgConfig Keywords and Variables | ||
| 9 | |||
| 10 | 5 | ▶ | use Syntax::Construct qw( non-destructive-subst ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 5 | our $VERSION = 'v2.0.2'; | |
| 13 | |||
| 14 | 5 | ▶ | use Regexp::Common 'balanced'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | |||
| 16 | |||
| 17 | |||
| 18 | |||
| 19 | |||
| 20 | |||
| 21 | |||
| 22 | |||
| 23 | |||
| 24 | 182 | ▶ | sub new { |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||
| 25 | 182 | my ( $class, $name, $value ) = @_; | |
| 26 | |||
| 27 | 182 | bless { | |
| 28 | name => $name, | ||
| 29 | value => $value, | ||
| 30 | depends => _parse_dependencies( $value ), | ||
| 31 | }, $class; | ||
| 32 | } | ||
| 33 | |||
| 34 | |||
| 35 | |||
| 36 | |||
| 37 | |||
| 38 | |||
| 39 | |||
| 40 | 351 | ▶ | sub name { return $_[0]->{name} } |
|
Subroutine
name: called CC=1 SCAR=0.0
Pod
documented
| |||
| 41 | |||
| 42 | |||
| 43 | |||
| 44 | |||
| 45 | |||
| 46 | |||
| 47 | |||
| 48 | 311 | ▶ | sub value { return $_[0]->{value} } |
|
Subroutine
value: called CC=1 SCAR=0.0
Pod
documented
| |||
| 49 | |||
| 50 | |||
| 51 | |||
| 52 | |||
| 53 | |||
| 54 | |||
| 55 | |||
| 56 | |||
| 57 | |||
| 58 | 202 | ▶ | sub depends { return @{ $_[0]->{depends} } } |
|
Subroutine
depends: called CC=1 SCAR=0.0
Pod
documented
| |||
| 59 | |||
| 60 | 182 | ▶ | sub _parse_dependencies { |
|
Subroutine
_parse_dependencies: called CC=1 SCAR=0.0
| |||
| 61 | 182 | my @depends = map { s/(?:^[{])|(?:[}]$)//gr } $_[0] =~ /(?<!\$)\$$RE{balanced}{-parens => '{}'}/g; | |
| 62 | |||
| 63 | 182 | my %depends; | |
| 64 | 182 | @depends{@depends} = (); | |
| 65 | |||
| 66 | 182 | return [ keys %depends ]; | |
| 67 | } | ||
| 68 | |||
| 69 | package App::mkpkgconfig::PkgConfig::Entry::Variable; | ||
| 70 | |||
| 71 | 5 | ▶ | use parent -norequire => 'App::mkpkgconfig::PkgConfig::Entry'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 72 | |||
| 73 | package App::mkpkgconfig::PkgConfig::Entry::Keyword; | ||
| 74 | |||
| 75 | 5 | ▶ | use parent -norequire => 'App::mkpkgconfig::PkgConfig::Entry'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 76 | |||
| 77 | 5 | 1; | |
| 78 | |||
| 79 | # | ||
| 80 | # This file is part of App-mkpkgconfig | ||
| 81 | # | ||
| 82 | # This software is Copyright (c) 2020 by Smithsonian Astrophysical Observatory. | ||
| 83 | # | ||
| 84 | # This is free software, licensed under: | ||
| 85 | # | ||
| 86 | # The GNU General Public License, Version 3, June 2007 | ||
| 87 | # | ||
| 88 | |||
| 89 | __END__ | ||