| 1 |
|
| ################################################################################ |
| 2 |
|
| # |
| 3 |
|
| # Copyright (c) 2002-2020 Marcus Holland-Moritz. All rights reserved. |
| 4 |
|
| # This program is free software; you can redistribute it and/or modify |
| 5 |
|
| # it under the same terms as Perl itself. |
| 6 |
|
| # |
| 7 |
|
| ################################################################################ |
| 8 |
|
| |
| 9 |
|
| |
| 10 |
|
| ################################################################################ |
| 11 |
|
| # |
| 12 |
|
| # METHOD: sourcify |
| 13 |
|
| # |
| 14 |
|
| # WRITTEN BY: Marcus Holland-Moritz ON: Oct 2002 |
| 15 |
|
| # CHANGED BY: ON: |
| 16 |
|
| # |
| 17 |
|
| ################################################################################ |
| 18 |
|
| |
| 19 |
|
| SV * |
| 20 |
|
| CBC::sourcify(...) |
| 21 |
|
| PREINIT: |
| 22 |
974 |
| CBC_METHOD(sourcify); |
| 23 |
|
| SourcifyConfig sc; |
| 24 |
|
| |
| 25 |
|
| CODE: |
| 26 |
|
| CT_DEBUG_METHOD; |
| 27 |
|
| |
| 28 |
974 |
▶ | CHECK_PARSE_DATA; |
Branch: 1 branch
| Branch | True | False | Total |
| CHECK_PARSE_DATA; |
6 |
968 |
974 |
|
| 29 |
968 |
▶ | CHECK_VOID_CONTEXT; |
Branch: 2 branches
| Branch | True | False | Total |
| CHECK_VOID_CONTEXT; |
6 |
962 |
968 |
| CHECK_VOID_CONTEXT; |
4 |
2 |
6 |
|
| 30 |
|
| |
| 31 |
|
| /* preset with defaults */ |
| 32 |
962 |
| sc.context = 0; |
| 33 |
962 |
| sc.defines = 0; |
| 34 |
|
| |
| 35 |
962 |
▶ | if (items == 2 && SvROK(ST(1))) |
Branch: 2 branches
| Branch | True | False | Total |
| if (items == 2 && SvROK(ST(1))) |
935 |
27 |
962 |
| if (items == 2 && SvROK(ST(1))) |
929 |
6 |
935 |
|
| 36 |
917 |
| { |
| 37 |
929 |
| SV *sv = SvRV(ST(1)); |
| 38 |
|
| |
| 39 |
929 |
▶ | if (SvTYPE(sv) == SVt_PVHV) |
Branch: 1 branch
| Branch | True | False | Total |
| if (SvTYPE(sv) == SVt_PVHV) |
923 |
6 |
929 |
|
| 40 |
923 |
| get_sourcify_config(aTHX_ (HV *) sv, &sc); |
| 41 |
|
| else |
| 42 |
6 |
| Perl_croak(aTHX_ "Need a hash reference for configuration options"); |
| 43 |
|
| } |
| 44 |
33 |
▶ | else if (items >= 2) |
Branch: 1 branch
| Branch | True | False | Total |
| else if (items >= 2) |
18 |
15 |
33 |
|
| 45 |
18 |
| Perl_croak(aTHX_ "Sourcification of individual types is not yet supported"); |
| 46 |
|
| |
| 47 |
932 |
| RETVAL = get_parsed_definitions_string(aTHX_ &THIS->cpi, &sc); |
| 48 |
|
| |
| 49 |
|
| OUTPUT: |
| 50 |
|
| RETVAL |
| 51 |
|
| |