Skip to content

Commit b350f28

Browse files
committed
start to port method command_line to nqp
1 parent a3d9dff commit b350f28

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

src/HLL/Compiler.pm

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -282,27 +282,25 @@ class HLL::Compiler {
282282
}
283283

284284
method command_line(@args, *%adverbs) {
285+
## this bizarre piece of code causes the compiler to
286+
## immediately abort if it looks like it's being run
287+
## from Perl's Test::Harness. (Test::Harness versions 2.64
288+
## from October 2006
289+
## and earlier have a hardwired commandline option that is
290+
## always passed to an initial run of the interpreter binary,
291+
## whether you want it or not.) We expect to remove this
292+
## check eventually (or make it a lot smarter than it is here).
293+
if pir::index(@args[2], '@INC') >= 0 {
294+
pir::exit(0);
295+
}
296+
my $program-name := @args[0];
285297
Q:PIR {
286298
.include 'except_severity.pasm'
287299
.local pmc args, adverbs, self
288300
args = find_lex '@args'
289301
adverbs = find_lex '%adverbs'
290302
self = find_lex 'self'
291303
292-
## this bizarre piece of code causes the compiler to
293-
## immediately abort if it looks like it's being run
294-
## from Perl's Test::Harness. (Test::Harness versions 2.64
295-
## from October 2006
296-
## and earlier have a hardwired commandline option that is
297-
## always passed to an initial run of the interpreter binary,
298-
## whether you want it or not.) We expect to remove this
299-
## check eventually (or make it a lot smarter than it is here).
300-
$S0 = args[2]
301-
$I0 = index $S0, '@INC'
302-
if $I0 < 0 goto not_harness
303-
exit 0
304-
not_harness:
305-
306304
load_bytecode 'dumper.pbc'
307305
load_bytecode 'PGE/Dumper.pbc'
308306

0 commit comments

Comments
 (0)