-
Notifications
You must be signed in to change notification settings - Fork 138
/
types.pm
61 lines (43 loc) · 1.19 KB
/
types.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Copyright (C) 2001-2011, Parrot Foundation.
=head1 NAME
config/inter/types.pm - Sizes for Parrot Types
=head1 DESCRIPTION
Asks the user which size integer, floating-point number and opcode types should
be.
=cut
package inter::types;
use strict;
use warnings;
use base qw(Parrot::Configure::Step);
use Parrot::Configure::Utils ':inter';
sub _init {
my $self = shift;
my %data;
$data{description} = q{What types should Parrot use};
$data{result} = q{};
return \%data;
}
sub runstep {
my ( $self, $conf ) = @_;
my $intval = $conf->options->get('intval') || 'long';
my $floatval = $conf->options->get('floatval') || 'double';
my $opcode = $intval;
if ( $conf->options->get('ask') ) {
$intval = prompt( "\n\nHow big would you like your integers to be?", $intval );
$floatval = prompt( "And your floats?", $floatval );
print "\n";
}
$conf->data->set(
iv => $intval,
nv => $floatval,
opcode_t => $opcode
);
return 1;
}
1;
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4: