Skip to content

Commit 336a77d

Browse files
author
Chris White
committed
Remove $C and @f (old test variables) [minor]
And a bit of other cleanup
1 parent a08718b commit 336a77d

File tree

7 files changed

+19
-45
lines changed

7 files changed

+19
-45
lines changed

MANIFEST

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ t/06-class-tests.t
3232
t/ex/02-noL.axk
3333
t/ex/02.axk
3434
t/ex/1.axk
35-
t/ex/2.axk
3635
t/ex/ex1.xml
3736
t/ex/lTEST.axk
3837
t/ex/nutrition.xml

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
To install this module, run the following commands:
66

7-
perl Makefile.PL
8-
make
9-
make test
10-
make install
7+
perl Makefile.PL
8+
make
9+
make test
10+
make install
1111

1212
## USAGE
1313

lib/XML/Axk/Core.pm

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ Load the given text, but do not execute it. Usage:
105105
106106
=cut
107107

108-
# TODO permit specifying a specific Ln?
109108
# @param $self
110109
# @param $text {String} The source text, **which load_script_text may modify.**
111110
# @param $filename {String} Filename to use in debugging messages
@@ -127,14 +126,13 @@ sub load_script_text {
127126
# Text to wrap around the script
128127
my ($leader, $trailer) = ('', '');
129128

130-
#say "Text is $text";
131129
my $hrInitialPragmas = {};
132-
$hrInitialPragmas = { L => {$curr_lang ? (name => '' . $curr_lang) : ()} }
133-
if $add_Ln || $curr_lang;
130+
if($add_Ln || $curr_lang) {
131+
$hrInitialPragmas = { L => {$curr_lang ? (name => '' . $curr_lang) : ()} };
132+
}
134133

135134
my ($lrPieces, $has_lang) = XML::Axk::Preparse::pieces(\$text, $hrInitialPragmas);
136135

137-
#say "Has lang" if $has_lang;
138136
unless($has_lang || $curr_lang) {
139137
if($add_Ln) {
140138
$lrPieces->[0]->{pragmas}->{L}->{digits} = 1; # default language
@@ -143,7 +141,6 @@ sub load_script_text {
143141
}
144142
}
145143

146-
#say Dumper($lrPieces);
147144
my $srNewText = XML::Axk::Preparse::assemble($fn, $lrPieces);
148145
$text = $$srNewText;
149146

@@ -252,10 +249,15 @@ sub run_sax_fh {
252249

253250
} #run_sax_fh()
254251

255-
# Run the loaded script(s). Takes a list of inputs. Strings are treated
256-
# as filenames; references to strings are treated as raw data to be run
257-
# as if read off disk. A filename of '-' represents STDIN. To process a
258-
# disk file named '-', read its contents first and pass them in as a ref.
252+
=head2 run
253+
254+
Run the loaded script or scripts. Takes a list of inputs. Strings are treated
255+
as filenames; references to strings are treated as raw data to be run
256+
as if read off disk. A filename of '-' represents STDIN. To process a
257+
disk file named '-', read its contents first and pass them in as a ref.
258+
259+
=cut
260+
259261
sub run {
260262
my $self = shift;
261263

@@ -270,11 +272,7 @@ sub run {
270272
my $fh;
271273
#say "Processing $infn";
272274

273-
# Clear the SPs before each file for consistency.
274-
# TODO remove $C and @F from the codebase and samples. They are
275-
# leftovers from before the split of the languages into Ln modules.
276-
$self->{sp}->{'$C'} = undef;
277-
@{$self->{sp}->{'@F'}} = ();
275+
# TODO? Clear the SPs before each file for consistency?
278276

279277
# For now, just process lines rather than XML nodes.
280278
if($infn eq '-') { # stdin
@@ -388,12 +386,6 @@ sub global_name {
388386

389387
=pod
390388
391-
=head2 load_script_file
392-
393-
=head2 load_script_text
394-
395-
=head2 run
396-
397389
=head1 AUTHOR
398390
399391
Christopher White, C<cxwembedded at gmail.com>

lib/XML/Axk/L/L1.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ sub sel {
184184
# Script parameters ============================================== {{{1
185185

186186
# Script-parameter names
187-
our @SP_names = qw($C @F $D $E $NOW);
187+
our @SP_names = qw($D $E $NOW);
188188

189189
sub update {
190190
#say "L1::update: ", Dumper(\@_);

t/ex/1.axk

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,8 @@ post_all { say "post_all"; };
1111

1212
my $x=42;
1313

14-
perform {
15-
#say join ' ', 'within perform $C',\$C,'@F',\@F;
16-
chomp $C;
17-
say "Line is=> $C";
18-
say join '; ', @F;
19-
$C = 'Modified $C ' . ++$x;
20-
} 'line!';
21-
2214
perform {
2315
say "Always";
24-
push @F, "from ex1";
2516
} always;
2617

2718
perform {

t/ex/2.axk

Lines changed: 0 additions & 8 deletions
This file was deleted.

t/tests/L1.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use AxkTest;
77
use parent 'Test::Class';
88
use Test::Exception;
99

10-
sub class { "XML::Axk::L1" };
10+
sub class { "XML::Axk::L::L1" };
1111

1212
diag("Testing ", class);
1313

0 commit comments

Comments
 (0)