Skip to content

Commit 3ccdf9e

Browse files
committed
Get the various QAST nodes we have stubbed in and start to fill some of them out.
1 parent 29da48d commit 3ccdf9e

File tree

11 files changed

+45
-9
lines changed

11 files changed

+45
-9
lines changed

src/QAST/BVal.nqp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
class QAST::BVal is QAST::Node { has $!block; method block(*@value) { $!block := @value[0] if @value; $!block }}

src/QAST/IVal.nqp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class QAST::IVal is QAST::Node {
2+
has int $!value;
3+
method value(*@value) { $!value := @value[0] if @value; $!value }
4+
}

src/QAST/NVal.nqp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class QAST::NVal is QAST::Node {
2+
has num $!value;
3+
method value(*@value) { $!value := @value[0] if @value; $!value }
4+
}

src/QAST/Node.nqp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
class QAST::Node is NQPCapture {
2-
has str $!name;
32
has $!node;
4-
has $!type;
3+
has str $!name;
4+
has $!returns;
5+
has int $!arity;
6+
has int $!flat;
7+
has str $!childorder;
58

69
method new(*@children, *%options) {
710
my $new := self.CREATE();
@@ -13,9 +16,15 @@ class QAST::Node is NQPCapture {
1316
$new;
1417
}
1518

16-
method name(*@value) { $!name := @value[0] if @value; $!name }
17-
method node(*@value) { $!node := @value[0] if @value; $!node }
19+
method node(*@value) { $!node := @value[0] if @value; $!node }
20+
method name(*@value) { $!name := @value[0] if @value; $!name }
21+
method returns(*@value) { $!returns := @value[0] if @value; $!returns }
22+
method arity(*@value) { $!arity := @value[0] if @value; $!arity }
23+
method flat(*@value) { $!flat := @value[0] if @value; $!flat }
24+
method childorder(*@value) { $!childorder := @value[0] if @value; $!childorder }
25+
26+
method pop() { nqp::pop(self.list) }
1827
method push($value) { nqp::push(self.list, $value) }
28+
method shift() { nqp::shift(self.list) }
1929
method unshift($value) { nqp::unshift(self.list, $value) }
20-
method type(*@value) { $!type := @value[0] if @value; $!type }
2130
}

src/QAST/SVal.nqp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class QAST::SVal is QAST::Node {
2+
has str $!value;
3+
method value(*@value) { $!value := @value[0] if @value; $!value }
4+
}

src/QAST/Stmt.nqp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class QAST::Stmt is QAST::Node {
2+
}

src/QAST/VM.nqp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class QAST::VM is QAST::Node {
2+
}

src/QAST/Var.nqp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class QAST::Var is QAST::Node {
2+
has $!scope;
3+
}

src/QAST/WVal.nqp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class QAST::WVal does QAST::CompileTimeValue {
2+
}

src/QAST/WorldValue.nqp

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)