Permalink
Browse files

Perlito5 - command-line option -B is now default

  • Loading branch information...
1 parent 39026fb commit 5ef57bb4dd4c88174637b1098f604d2d48f54367 @fglock committed Apr 12, 2012
Showing with 23 additions and 24 deletions.
  1. +14 −0 ChangeLog
  2. +5 −10 perlito5.pl
  3. +4 −14 src5/util/perlito5.pl
View
@@ -1,3 +1,17 @@
+dev 2012-04-12
+
+* Perlito5 (Perl 5 compiler):
+
+- parser:
+
+-- autoquote hash-keys fix
+-- option "-B" is now the default; this executes immediately: perlito5 -e 'say "ok"'
+
+
+* Perlito6 (Perl 6 compiler):
+
+
+
9.0 2012-04-11
* Perlito5 (Perl 5 compiler):
View
@@ -23,8 +23,8 @@ package Perlito;
((my $_V5_COMPILER_NAME) = 'Perlito5');
((my $_V5_COMPILER_VERSION) = '9.0');
((my $source) = '');
-((my $backend) = '');
-((my $execute) = 0);
+((my $backend) = $main::^O);
+((my $execute) = 1);
((my $verbose) = 0);
((my $expand_use) = 1);
if ($verbose) {
@@ -49,22 +49,17 @@ package Perlito;
}
};
if ((substr($ARGV[0], 0, 2) eq '-B')) {
- ($backend = substr($ARGV[0], 2, 10));
- ($execute = 1);
- shift(@ARGV);
- if ((((($backend eq 'perl5') || ($backend eq 'python')) || ($backend eq 'ruby')) || ($backend eq 'js'))) {
- ($expand_use = 0)
- }
+ shift(@ARGV)
};
if (((($ARGV[0] eq '-V')) || (($ARGV[0] eq '--version')))) {
($backend = '');
Perlito5::Runtime::say($_V5_COMPILER_NAME, ' ', $_V5_COMPILER_VERSION);
shift(@ARGV)
}
else {
- if ((((($ARGV[0] eq '-h')) || (($ARGV[0] eq '--help'))) || (($backend eq '')))) {
+ if (((($ARGV[0] eq '-h') || ($ARGV[0] eq '--help')) || !(@ARGV))) {
($backend = '');
- Perlito5::Runtime::say($_V5_COMPILER_NAME, ' ', $_V5_COMPILER_VERSION, chr(10) . 'perlito5 [switches] [programfile]' . chr(10) . ' switches:' . chr(10) . ' -h --help' . chr(10) . ' -v --verbose' . chr(10) . ' -V --version' . chr(10) . ' -Idirectory specify @INC/include directory (several -I' . chr(39) . 's allowed)' . chr(10) . ' -Ctarget target backend: js, perl5, perl6' . chr(10) . ' -Cast-perl5 emits a dump of the abstract syntax tree' . chr(10) . ' -Btarget execute using the backend: js' . chr(10) . ' --expand_use --noexpand_use' . chr(10) . ' expand ' . chr(39) . 'use' . chr(39) . ' statements at compile time' . chr(10) . ' -e program one line of program (omit programfile)' . chr(10));
+ Perlito5::Runtime::say($_V5_COMPILER_NAME, ' ', $_V5_COMPILER_VERSION, chr(10) . 'perlito5 [switches] [programfile]' . chr(10) . ' switches:' . chr(10) . ' -h --help' . chr(10) . ' -v --verbose' . chr(10) . ' -V --version' . chr(10) . ' -Idirectory specify @INC/include directory (several -I' . chr(39) . 's allowed)' . chr(10) . ' -Ctarget target backend: js, perl5, perl6' . chr(10) . ' -Cast-perl5 emits a dump of the abstract syntax tree' . chr(10) . ' --expand_use --noexpand_use' . chr(10) . ' expand ' . chr(39) . 'use' . chr(39) . ' statements at compile time' . chr(10) . ' -e program one line of program (omit programfile)' . chr(10));
shift(@ARGV)
}
};
View
@@ -23,8 +23,8 @@ package Perlito;
my $_V5_COMPILER_NAME = 'Perlito5';
my $_V5_COMPILER_VERSION = '9.0';
my $source = '';
-my $backend = '';
-my $execute = 0;
+my $backend = $^O;
+my $execute = 1;
my $verbose = 0;
my $expand_use = 1;
@@ -56,24 +56,15 @@ package Perlito;
}
}
if (substr($ARGV[0], 0, 2) eq '-B') {
- $backend = substr($ARGV[0], 2, 10);
- $execute = 1;
+ # obsolete option, "execute" is now default
shift @ARGV;
- if ( $backend eq 'perl5'
- || $backend eq 'python'
- || $backend eq 'ruby'
- || $backend eq 'js'
- )
- {
- $expand_use = 0;
- }
}
if (($ARGV[0] eq '-V') || ($ARGV[0] eq '--version')) {
$backend = '';
say $_V5_COMPILER_NAME, " ", $_V5_COMPILER_VERSION;
shift @ARGV;
}
-elsif (($ARGV[0] eq '-h') || ($ARGV[0] eq '--help') || ($backend eq '')) {
+elsif ($ARGV[0] eq '-h' || $ARGV[0] eq '--help' || !@ARGV) {
$backend = '';
say $_V5_COMPILER_NAME, " ", $_V5_COMPILER_VERSION, "
perlito5 [switches] [programfile]
@@ -84,7 +75,6 @@ package Perlito;
-Idirectory specify \@INC/include directory (several -I's allowed)
-Ctarget target backend: js, perl5, perl6
-Cast-perl5 emits a dump of the abstract syntax tree
- -Btarget execute using the backend: js
--expand_use --noexpand_use
expand 'use' statements at compile time
-e program one line of program (omit programfile)

0 comments on commit 5ef57bb

Please sign in to comment.