Permalink
Browse files

Packfile.Subroutine: Build from a core Sub

This also stores the Sub inside the Subroutine for future reference.
  • Loading branch information...
1 parent 05dc11a commit 72a30ea3a1b8e0619754faedc9168169012ca216 @Benabik Benabik committed Aug 9, 2012
Showing with 11 additions and 2 deletions.
  1. +11 −2 src/PACT/Packfile.winxed
@@ -1,5 +1,7 @@
$include_const 'call_bits.pasm';
+class Sub; // Core type
+
class PACT.Packfile {
// Constants
var floats; // RFA
@@ -221,8 +223,9 @@ namespace PACT.Packfile {
// Below are found in Namespace.contents
class Subroutine {
- var name; // String
- var ops; // RPA
+ var name; // String
+ var ops; // RPA
+ var sub; // Actual sub PMC (for during {dis,}assembly)
// Stored by Sub PMC
// visit: namespace_name, multi_sig, outer_sub, lex_info
@@ -239,6 +242,12 @@ namespace PACT.Packfile {
self.name = name;
}
+ function Subroutine(:Sub sub) {
+ self.Subroutine();
+ self.name = string(sub);
+ self.sub = sub;
+ }
+
function __dump(var dumper, string label) {
print(self.name, ': ');
dumper.dump(label, self.ops);

0 comments on commit 72a30ea

Please sign in to comment.