Skip to content

Commit 702c1b7

Browse files
committed
Add a QAST::CompUnit, which will be involved in SC handling and a few other things we have one of per compilation unit.
1 parent 20a37a9 commit 702c1b7

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/QAST/CompUnit.nqp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
class QAST::CompUnit is QAST::Node {
2+
# The serialization context for the compilation unit.
3+
has $!sc;
4+
5+
# The HLL name.
6+
has $!hll;
7+
8+
# What to run at the point the compilation unit is loaded.
9+
has $!load;
10+
11+
# What to run if this is the main entry point.
12+
has $!main;
13+
14+
method sc(*@value) { $!sc := @value[0] if @value; $!sc }
15+
method hll(*@value) { $!hll := @value[0] if @value; $!hll }
16+
method load(*@value) { $!load := @value[0] if @value; $!load }
17+
method main(*@value) { $!main := @value[0] if @value; $!main }
18+
}

tools/build/Makefile.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ QAST_SOURCES = \
8383
src/QAST/Stmts.nqp \
8484
src/QAST/Stmt.nqp \
8585
src/QAST/Block.nqp \
86+
src/QAST/CompUnit.nqp \
8687
src/QAST/Operations.nqp \
8788
src/QAST/Compiler.nqp \
8889

0 commit comments

Comments
 (0)