/
core_prologue.pm6
74 lines (62 loc) · 2.24 KB
/
core_prologue.pm6
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
62
63
64
65
66
67
68
69
70
71
72
73
74
# Stub a few things the compiler wants to have really early on.
my class Pair { ... } # must be first for some reason
my class Block { ... }
my class HyperWhatever { ... }
my class List { ... }
my class Map { ... }
my class Match { ... }
my class Failure { ... }
my class Rakudo::Deprecations { ... }
my class Rakudo::Internals { ... }
my class Rakudo::Internals::JSON { ... }
my class Rakudo::Internals::RegexBoolification6cMarker { ... }
my class Rakudo::Internals::HyperWorkBatch { ... }
my class Rakudo::Iterator { ... }
#?if !js
my class ThreadPoolScheduler { ... }
#?endif
#?if js
my class JavaScriptScheduler { ... }
#?endif
my class Whatever { ... }
my class WhateverCode { ... }
my class X::Attribute::Required { ... }
my class X::Numeric::Overflow { ... }
my class X::Numeric::Underflow { ... }
# Stub these or we can't use any sigil other than $.
my role Positional { ... }
my role Associative { ... }
my role Callable { ... }
my role Iterable { ... }
my role PositionalBindFailover { ... }
# Make Iterable available for the code-gen.
BEGIN nqp::bindhllsym('perl6', 'Iterable', Iterable);
nqp::bindhllsym('perl6', 'Iterable', Iterable);
# Set up Empty, which is a Slip created with an empty IterationBuffer (which
# we also stub here). This is needed in a bunch of simple constructs (like if
# with only one branch).
my class IterationBuffer is repr('VMArray') { ... }
my constant Empty = nqp::p6bindattrinvres(nqp::create(Slip),
List, '$!reified', nqp::create(IterationBuffer));
# We use a sentinel value to mark the end of an iteration.
my constant IterationEnd = nqp::create(Mu);
# To allow passing of nqp::hash without being HLLized, we create a HLL class
# with the same low level REPR as nqp::hash.
my class Rakudo::Internals::IterationSet is repr('VMHash') { }
# The value for \n.
my constant $?NL = "\x0A";
# Make sure we have an environment
PROCESS::<%ENV> := Rakudo::Internals.createENV(0);
# This thread pool scheduler will be the default one.
#?if !js
PROCESS::<$SCHEDULER> = ThreadPoolScheduler.new();
#?endif
#?if js
PROCESS::<$SCHEDULER> = JavaScriptScheduler.new();
#?endif
#?if jvm
BEGIN {nqp::p6setassociativetype(Associative);}
#?endif
# This constant is only to support tests.
my constant CORE-SETTING-REV = 'c';
# vim: ft=perl6 expandtab sw=4