Switch branches/tags
6pe-mop RT123215 actions_shared allomorphs alpha angular_bracket_literal_semantics arr-con-not-item attr-isrequired better-errors-for-roles better_line_coverage birdless-2 birdless callable-default-value claim-prototype coerce-multi cont_reuse cont container-compare-metaop cpp curli curly definedness_for_hash_and_arr_sigil dist_resources eval-server-improvements execname export-constant failed_match2Nil for-mvm-pr291 froggs_multibyte from_nqp glrish gmr gsr hotfix-2015.01 hyper_threaded inherit-from-nqp-class inliner install-dir-layout interface-inconsistency io-pipe io jsoff jvm-hacking jvm-sockets jvm-support jvm_interop_dispatchers jvmbl lazy-subst leave lex2loc2 lines-vm-chomp list-v-cache load_precompiled_deps lolly longlit method2sub moar-conc moar-gen2-frame-opts moreinput multi_arity_sequence_endpoint multidim named_pod_vars native-str-ops nativecall-cint new-nil newio ng nil-assign nil-noniterable no-strict no-vm-at-startup no_p5_warnings nom nqp-dogfood optimize_for_again optimizer-void-context optimizer_lexicalref_lowering p6for_op parameter-perl parrot-690 parrot-icu-required parrot-iocleanup1-take2 parrot-iocleanup1 pirt platform_library_name pod-table pr/229 precomp-singleprocess priv-role-attrs proc-async-ready proper_control_multi_subs prune_matches qast_lazy_annotation qast_refactor qast_restructure r-regex_optimizer rebuf recursive-gist regex_optimizer release/2015.07.2 repository_registry resources richer-positional role_diamond safely_stringify_core_exceptions scalar-from-desc setops shaped_nonnative_typed_arrays sigsp sink-phasers sized-arrays smile spacey spesh_decont_contspec staged-settings standalone-jar stdier test-betterer there_is_no_return thunkyreduce tmp_highfive toqast try-does-use-fatal unfaster-words use-nqp var-traits varopt vm-null vmarray-list vmarray wip-openpipe
Nothing to show
Find file
54 lines (46 sloc) 1.38 KB
use Perl6::Grammar;
use Perl6::Actions;
use Perl6::Compiler;
# Initialize Rakudo runtime support.
nqp::p6init();
# Create and configure compiler object.
my $comp := Perl6::Compiler.new();
$comp.language('perl6');
$comp.parsegrammar(Perl6::Grammar);
$comp.parseactions(Perl6::Actions);
$comp.addstage('syntaxcheck', :before<ast>);
$comp.addstage('optimize', :after<ast>);
hll-config($comp.config);
nqp::bindhllsym('perl6', '$COMPILER_CONFIG', $comp.config);
# Add extra command line options.
my @clo := $comp.commandline_options();
@clo.push('parsetrace');
@clo.push('setting=s');
@clo.push('n');
@clo.push('p');
@clo.push('doc=s?');
@clo.push('optimize=s?');
@clo.push('c');
@clo.push('I=s');
@clo.push('M=s');
# Set up END block list, which we'll run at exit.
nqp::bindhllsym('perl6', '@END_PHASERS', []);
# In an embedding environment, let @*ARGS be empty instead of crashing
nqp::bindhllsym('perl6', '$!ARGITER', 0);
#?if jvm
sub MAIN(*@ARGS) {
#?endif
#?if moar
sub MAIN(@ARGS) {
#?endif
# Enter the compiler.
$comp.command_line(@ARGS, :encoding('utf8'), :transcode('ascii iso-8859-1'));
# Run any END blocks before exiting.
my @END := nqp::gethllsym('perl6', '@END_PHASERS');
while +@END {
my $result := (@END.shift)();
nqp::can($result, 'sink') && $result.sink();
CATCH { $comp.handle-exception($_); }
CONTROL { $comp.handle-control($_); }
}
}
Jump to Line