Add information about .cfp file to CFCParcel

Pass a CFCFileSpec to CFCParcel so it knows about the source or include
dir and full path of the .cfp file.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/c4b75803
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/c4b75803
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/c4b75803

Branch: refs/heads/include_dir_fixes
Commit: c4b758036a8f0d2675ec9b39815126b4a6872dd6
Parents: 79f8473
Author: Nick Wellnhofer <[email protected]>
Authored: Fri Aug 1 13:47:46 2014 +0200
Committer: Nick Wellnhofer <[email protected]>
Committed: Fri Aug 1 15:35:29 2014 +0200

----------------------------------------------------------------------
 compiler/perl/lib/Clownfish/CFC.pm | 22 ++++++++--------
 compiler/perl/lib/Clownfish/CFC.xs | 18 ++++++-------
 compiler/perl/t/403-parcel.t       | 29 ++++++++++++++++-----
 compiler/src/CFCHierarchy.c        | 16 +++++++++++-
 compiler/src/CFCParcel.c           | 46 +++++++++++++++++++++++----------
 compiler/src/CFCParcel.h           | 21 ++++++++++++---
 compiler/src/CFCParseHeader.y      | 13 ++++------
 compiler/src/CFCTestParcel.c       | 26 ++++++++++++-------
 compiler/src/CFCTestParser.c       |  2 +-
 compiler/src/CFCTestSymbol.c       |  8 +++---
 compiler/src/CFCTestType.c         | 12 ++++-----
 11 files changed, 140 insertions(+), 73 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/c4b75803/compiler/perl/lib/Clownfish/CFC.pm
----------------------------------------------------------------------
diff --git a/compiler/perl/lib/Clownfish/CFC.pm 
b/compiler/perl/lib/Clownfish/CFC.pm
index 8b80ea5..7dd8171 100644
--- a/compiler/perl/lib/Clownfish/CFC.pm
+++ b/compiler/perl/lib/Clownfish/CFC.pm
@@ -351,41 +351,41 @@ BEGIN { XSLoader::load( 'Clownfish::CFC', '0.01' ) }
     use Carp;
 
     our %new_PARAMS = (
-        name        => undef,
-        nickname    => undef,
-        version     => undef,
-        is_included => undef,
+        name      => undef,
+        nickname  => undef,
+        version   => undef,
+        file_spec => undef,
     );
 
     sub new {
         my ( $either, %args ) = @_;
         verify_args( \%new_PARAMS, %args ) or confess $@;
         confess "no subclassing allowed" unless $either eq __PACKAGE__;
-        return _new( @args{qw( name nickname version is_included )} );
+        return _new( @args{qw( name nickname version file_spec )} );
     }
 
     our %new_from_json_PARAMS = (
-        json        => undef,
-        is_included => undef,
+        json      => undef,
+        file_spec => undef,
     );
 
     sub new_from_json {
         my ( $either, %args ) = @_;
         verify_args( \%new_from_json_PARAMS, %args ) or confess $@;
         confess "no subclassing allowed" unless $either eq __PACKAGE__;
-        return _new_from_json( @args{qw( json is_included )} );
+        return _new_from_json( @args{qw( json file_spec )} );
     }
 
     our %new_from_file_PARAMS = (
-        path        => undef,
-        is_included => undef,
+        path      => undef,
+        file_spec => undef,
     );
 
     sub new_from_file {
         my ( $either, %args ) = @_;
         verify_args( \%new_from_file_PARAMS, %args ) or confess $@;
         confess "no subclassing allowed" unless $either eq __PACKAGE__;
-        return _new_from_file( @args{qw( path is_included )} );
+        return _new_from_file( @args{qw( path file_spec )} );
     }
 
 #    $parcel = 
Clownfish::CFC::Model::Parcel->acquire($parcel_name_or_parcel_object);

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/c4b75803/compiler/perl/lib/Clownfish/CFC.xs
----------------------------------------------------------------------
diff --git a/compiler/perl/lib/Clownfish/CFC.xs 
b/compiler/perl/lib/Clownfish/CFC.xs
index c1983b7..a6ea249 100644
--- a/compiler/perl/lib/Clownfish/CFC.xs
+++ b/compiler/perl/lib/Clownfish/CFC.xs
@@ -1061,35 +1061,35 @@ PPCODE:
 MODULE = Clownfish::CFC   PACKAGE = Clownfish::CFC::Model::Parcel
 
 SV*
-_new(name_sv, nickname_sv, version, is_included)
+_new(name_sv, nickname_sv, version, file_spec)
     SV *name_sv;
     SV *nickname_sv;
     CFCVersion *version;
-    bool is_included;
+    CFCFileSpec *file_spec;
 CODE:
     const char *name     = SvOK(name_sv)  ? SvPV_nolen(name_sv)  : NULL;
     const char *nickname = SvOK(nickname_sv) ? SvPV_nolen(nickname_sv) : NULL;
-    CFCParcel *self = CFCParcel_new(name, nickname, version, is_included);
+    CFCParcel *self = CFCParcel_new(name, nickname, version, file_spec);
     RETVAL = S_cfcbase_to_perlref(self);
     CFCBase_decref((CFCBase*)self);
 OUTPUT: RETVAL
 
 SV*
-_new_from_file(path, is_included)
+_new_from_file(path, file_spec)
     const char *path;
-    bool is_included;
+    CFCFileSpec *file_spec;
 CODE:
-    CFCParcel *self = CFCParcel_new_from_file(path, is_included);
+    CFCParcel *self = CFCParcel_new_from_file(path, file_spec);
     RETVAL = S_cfcbase_to_perlref(self);
     CFCBase_decref((CFCBase*)self);
 OUTPUT: RETVAL
 
 SV*
-_new_from_json(json, is_included)
+_new_from_json(json, file_spec)
     const char *json;
-    bool is_included;
+    CFCFileSpec *file_spec;
 CODE:
-    CFCParcel *self = CFCParcel_new_from_json(json, is_included);
+    CFCParcel *self = CFCParcel_new_from_json(json, file_spec);
     RETVAL = S_cfcbase_to_perlref(self);
     CFCBase_decref((CFCBase*)self);
 OUTPUT: RETVAL

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/c4b75803/compiler/perl/t/403-parcel.t
----------------------------------------------------------------------
diff --git a/compiler/perl/t/403-parcel.t b/compiler/perl/t/403-parcel.t
index 2121322..25ac79b 100644
--- a/compiler/perl/t/403-parcel.t
+++ b/compiler/perl/t/403-parcel.t
@@ -52,10 +52,15 @@ eval { $same_nick->register; };
 like( $@, qr/parcel with nickname .* already registered/i,
       "can't register two parcels with the same nickname" );
 
-my $included_foo = Clownfish::CFC::Model::Parcel->new(
-    name        => "IncludedFoo",
+my $foo_file_spec = Clownfish::CFC::Model::FileSpec->new(
+    source_dir  => '.',
+    path_part   => 'Foo.cfp',
     is_included => 1,
 );
+my $included_foo = Clownfish::CFC::Model::Parcel->new(
+    name      => "IncludedFoo",
+    file_spec => $foo_file_spec,
+);
 ok( $included_foo->included, "included" );
 $included_foo->register;
 
@@ -140,20 +145,30 @@ Clownfish::CFC::Model::Parcel->reap_singletons();
 }
 
 {
-    my $foo = Clownfish::CFC::Model::Parcel->new(
-        name        => 'Foo',
+    my $foo_file_spec = Clownfish::CFC::Model::FileSpec->new(
+        source_dir  => '.',
+        path_part   => 'Foo.cfp',
         is_included => 1,
     );
+    my $foo = Clownfish::CFC::Model::Parcel->new(
+        name      => 'Foo',
+        file_spec => $foo_file_spec,
+    );
     $foo->register;
 
     my $cfish_version = Clownfish::CFC::Model::Version->new(
         vstring => 'v0.8.7',
     );
-    my $cfish = Clownfish::CFC::Model::Parcel->new(
-        name        => 'Clownfish',
-        version     => $cfish_version,
+    my $cfish_file_spec = Clownfish::CFC::Model::FileSpec->new(
+        source_dir  => '.',
+        path_part   => 'Clownfish.cfp',
         is_included => 1,
     );
+    my $cfish = Clownfish::CFC::Model::Parcel->new(
+        name      => 'Clownfish',
+        version   => $cfish_version,
+        file_spec => $cfish_file_spec,
+    );
     $cfish->register;
 
     my $json = qq|

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/c4b75803/compiler/src/CFCHierarchy.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCHierarchy.c b/compiler/src/CFCHierarchy.c
index 672b7c1..9cc1999 100644
--- a/compiler/src/CFCHierarchy.c
+++ b/compiler/src/CFCHierarchy.c
@@ -253,10 +253,23 @@ S_parse_parcel_files(const char *source_dir, int 
is_included) {
     context.num_paths = 0;
     CFCUtil_walk(source_dir, S_find_files, &context);
 
+    size_t source_dir_len = strlen(source_dir);
+
     // Parse .cfp files and register the parcels they define.
     for (int i = 0; context.paths[i] != NULL; i++) {
         const char *path = context.paths[i];
-        CFCParcel *parcel = CFCParcel_new_from_file(path, is_included);
+
+        if (strncmp(path, source_dir, source_dir_len) != 0) {
+            CFCUtil_die("'%s' doesn't start with '%s'", path, source_dir);
+        }
+        const char *path_part = path + source_dir_len;
+        while (*path_part == CHY_DIR_SEP_CHAR) {
+            ++path_part;
+        }
+
+        CFCFileSpec *file_spec
+            = CFCFileSpec_new(source_dir, path_part, is_included);
+        CFCParcel *parcel = CFCParcel_new_from_file(path, file_spec);
         const char *name = CFCParcel_get_name(parcel);
         CFCParcel *existing = CFCParcel_fetch(name);
         if (existing) {
@@ -277,6 +290,7 @@ S_parse_parcel_files(const char *source_dir, int 
is_included) {
             CFCParcel_register(parcel);
         }
         CFCBase_decref((CFCBase*)parcel);
+        CFCBase_decref((CFCBase*)file_spec);
     }
 
     S_free_find_files_context(&context);

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/c4b75803/compiler/src/CFCParcel.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCParcel.c b/compiler/src/CFCParcel.c
index 15811e8..f54c81c 100644
--- a/compiler/src/CFCParcel.c
+++ b/compiler/src/CFCParcel.c
@@ -26,6 +26,7 @@
 #define CFC_NEED_BASE_STRUCT_DEF
 #include "CFCBase.h"
 #include "CFCParcel.h"
+#include "CFCFileSpec.h"
 #include "CFCVersion.h"
 #include "CFCUtil.h"
 
@@ -34,11 +35,11 @@ struct CFCParcel {
     char *name;
     char *nickname;
     CFCVersion *version;
+    CFCFileSpec *file_spec;
     char *prefix;
     char *Prefix;
     char *PREFIX;
     char *privacy_sym;
-    int is_included;
     int is_required;
     char **inherited_parcels;
     size_t num_inherited_parcels;
@@ -155,14 +156,14 @@ static const CFCMeta CFCPARCEL_META = {
 
 CFCParcel*
 CFCParcel_new(const char *name, const char *nickname, CFCVersion *version,
-              int is_included) {
+              CFCFileSpec *file_spec) {
     CFCParcel *self = (CFCParcel*)CFCBase_allocate(&CFCPARCEL_META);
-    return CFCParcel_init(self, name, nickname, version, is_included);
+    return CFCParcel_init(self, name, nickname, version, file_spec);
 }
 
 CFCParcel*
 CFCParcel_init(CFCParcel *self, const char *name, const char *nickname,
-               CFCVersion *version, int is_included) {
+               CFCVersion *version, CFCFileSpec *file_spec) {
     // Validate name.
     if (!name || !S_validate_name_or_nickname(name)) {
         CFCUtil_die("Invalid name: '%s'", name ? name : "[NULL]");
@@ -189,6 +190,9 @@ CFCParcel_init(CFCParcel *self, const char *name, const 
char *nickname,
         self->version = CFCVersion_new("v0");
     }
 
+    // Set file_spec.
+    self->file_spec = (CFCFileSpec*)CFCBase_incref((CFCBase*)file_spec);
+
     // Derive prefix, Prefix, PREFIX.
     size_t nickname_len  = strlen(self->nickname);
     size_t prefix_len = nickname_len ? nickname_len + 1 : 0;
@@ -222,7 +226,6 @@ CFCParcel_init(CFCParcel *self, const char *name, const 
char *nickname,
     self->privacy_sym[privacy_sym_len] = '\0';
 
     // Initialize flags.
-    self->is_included = is_included;
     self->is_required = false;
 
     // Initialize arrays.
@@ -237,7 +240,7 @@ CFCParcel_init(CFCParcel *self, const char *name, const 
char *nickname,
 }
 
 static CFCParcel*
-S_new_from_json(const char *json, const char *path, int is_included) {
+S_new_from_json(const char *json, const char *path, CFCFileSpec *file_spec) {
     JSONNode *parsed = S_parse_json_for_parcel(json);
     if (!parsed) {
         CFCUtil_die("Invalid JSON parcel definition in '%s'", path);
@@ -293,7 +296,7 @@ S_new_from_json(const char *json, const char *path, int 
is_included) {
     if (!version) {
         CFCUtil_die("Missing required key 'version' (filepath '%s')", path);
     }
-    CFCParcel *self = CFCParcel_new(name, nickname, version, is_included);
+    CFCParcel *self = CFCParcel_new(name, nickname, version, file_spec);
     if (prereqs) {
         S_set_prereqs(self, prereqs, path);
     }
@@ -338,15 +341,15 @@ S_set_prereqs(CFCParcel *self, JSONNode *node, const char 
*path) {
 }
 
 CFCParcel*
-CFCParcel_new_from_json(const char *json, int is_included) {
-    return S_new_from_json(json, "[NULL]", is_included);
+CFCParcel_new_from_json(const char *json, CFCFileSpec *file_spec) {
+    return S_new_from_json(json, "[NULL]", file_spec);
 }
 
 CFCParcel*
-CFCParcel_new_from_file(const char *path, int is_included) {
+CFCParcel_new_from_file(const char *path, CFCFileSpec *file_spec) {
     size_t len;
     char *json = CFCUtil_slurp_text(path, &len);
-    CFCParcel *self = S_new_from_json(json, path, is_included);
+    CFCParcel *self = S_new_from_json(json, path, file_spec);
     FREEMEM(json);
     return self;
 }
@@ -356,6 +359,7 @@ CFCParcel_destroy(CFCParcel *self) {
     FREEMEM(self->name);
     FREEMEM(self->nickname);
     CFCBase_decref((CFCBase*)self->version);
+    CFCBase_decref((CFCBase*)self->file_spec);
     FREEMEM(self->prefix);
     FREEMEM(self->Prefix);
     FREEMEM(self->PREFIX);
@@ -382,7 +386,9 @@ CFCParcel_equals(CFCParcel *self, CFCParcel *other) {
     if (CFCVersion_compare_to(self->version, other->version) != 0) {
         return false;
     }
-    if (self->is_included != other->is_included) { return false; }
+    if (CFCParcel_included(self) != CFCParcel_included(other)) {
+        return false;
+    }
     return true;
 }
 
@@ -421,9 +427,23 @@ CFCParcel_get_privacy_sym(CFCParcel *self) {
     return self->privacy_sym;
 }
 
+const char*
+CFCParcel_get_cfp_path(CFCParcel *self) {
+    return self->file_spec
+           ? CFCFileSpec_get_path(self->file_spec)
+           : NULL;
+}
+
+const char*
+CFCParcel_get_source_dir(CFCParcel *self) {
+    return self->file_spec
+           ? CFCFileSpec_get_source_dir(self->file_spec)
+           : NULL;
+}
+
 int
 CFCParcel_included(CFCParcel *self) {
-    return self->is_included;
+    return self->file_spec ? CFCFileSpec_included(self->file_spec) : false;
 }
 
 int

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/c4b75803/compiler/src/CFCParcel.h
----------------------------------------------------------------------
diff --git a/compiler/src/CFCParcel.h b/compiler/src/CFCParcel.h
index ec3d99a..9bd37be 100644
--- a/compiler/src/CFCParcel.h
+++ b/compiler/src/CFCParcel.h
@@ -38,6 +38,7 @@ extern "C" {
 
 typedef struct CFCParcel CFCParcel;
 typedef struct CFCPrereq CFCPrereq;
+struct CFCFileSpec;
 struct CFCVersion;
 
 /** Return the parcel which has been registered for <code>name</code>.
@@ -63,17 +64,17 @@ CFCParcel_reap_singletons(void);
 
 CFCParcel*
 CFCParcel_new(const char *name, const char *nickname,
-              struct CFCVersion *version, int is_included);
+              struct CFCVersion *version, struct CFCFileSpec *file_spec);
 
 CFCParcel*
-CFCParcel_new_from_file(const char *path, int is_included);
+CFCParcel_new_from_file(const char *path, struct CFCFileSpec *file_spec);
 
 CFCParcel*
-CFCParcel_new_from_json(const char *json, int is_included);
+CFCParcel_new_from_json(const char *json, struct CFCFileSpec *file_spec);
 
 CFCParcel*
 CFCParcel_init(CFCParcel *self, const char *name, const char *nickname,
-               struct CFCVersion *version, int is_included);
+               struct CFCVersion *version, struct CFCFileSpec *file_spec);
 
 void
 CFCParcel_destroy(CFCParcel *self);
@@ -110,6 +111,18 @@ CFCParcel_get_PREFIX(CFCParcel *self);
 const char*
 CFCParcel_get_privacy_sym(CFCParcel *self);
 
+/* Return the path to the Parcel's .cfp file. May return NULL if the parcel
+ * wasn't created from a file.
+ */
+const char*
+CFCParcel_get_cfp_path(CFCParcel *self);
+
+/* Return the Parcel's source or include dir. May return NULL if the parcel
+ * wasn't created from a file.
+ */
+const char*
+CFCParcel_get_source_dir(CFCParcel *self);
+
 /** Return true if the parcel is from an include directory.
  */
 int

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/c4b75803/compiler/src/CFCParseHeader.y
----------------------------------------------------------------------
diff --git a/compiler/src/CFCParseHeader.y b/compiler/src/CFCParseHeader.y
index 13912d9..5e609df 100644
--- a/compiler/src/CFCParseHeader.y
+++ b/compiler/src/CFCParseHeader.y
@@ -330,16 +330,13 @@ parcel_definition(A) ::= PARCEL qualified_id(B) SEMICOLON.
 {
     A = CFCParcel_fetch(B);
     if (!A) {
-        CFCFileSpec *file_spec = CFCParser_get_file_spec(state);
-        int is_included = false;
-        if (file_spec) {
-            is_included = CFCFileSpec_included(file_spec);
-        }
-        A = CFCParcel_new(B, NULL, NULL, is_included);
+        /* Allow unregistered parcels to simplify tests. */
+        A = CFCParcel_new(B, NULL, NULL, NULL);
         CFCParcel_register(A);
-        CFCBase_decref((CFCBase*)A);
     }
-    CFCBase_incref((CFCBase*)A);
+    else {
+        CFCBase_incref((CFCBase*)A);
+    }
     CFCParser_set_parcel(state, A);
 }
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/c4b75803/compiler/src/CFCTestParcel.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCTestParcel.c b/compiler/src/CFCTestParcel.c
index 46d8f1c..0c171e2 100644
--- a/compiler/src/CFCTestParcel.c
+++ b/compiler/src/CFCTestParcel.c
@@ -18,6 +18,7 @@
 
 #define CFC_USE_TEST_MACROS
 #include "CFCBase.h"
+#include "CFCFileSpec.h"
 #include "CFCParcel.h"
 #include "CFCSymbol.h"
 #include "CFCUtil.h"
@@ -78,16 +79,18 @@ S_run_prereq_tests(CFCTest *test) {
 static void
 S_run_parcel_tests(CFCTest *test) {
     {
-        CFCParcel *parcel = CFCParcel_new("Foo", NULL, NULL, false);
+        CFCParcel *parcel = CFCParcel_new("Foo", NULL, NULL, NULL);
         OK(test, parcel != NULL, "new");
         OK(test, !CFCParcel_included(parcel), "not included");
         CFCBase_decref((CFCBase*)parcel);
     }
 
     {
-        CFCParcel *parcel = CFCParcel_new("Foo", NULL, NULL, true);
+        CFCFileSpec *file_spec = CFCFileSpec_new(".", "Parcel.cfp", true);
+        CFCParcel *parcel = CFCParcel_new("Foo", NULL, NULL, file_spec);
         OK(test, CFCParcel_included(parcel), "included");
         CFCBase_decref((CFCBase*)parcel);
+        CFCBase_decref((CFCBase*)file_spec);
     }
 
     {
@@ -97,20 +100,20 @@ S_run_parcel_tests(CFCTest *test) {
             "            \"nickname\": \"Crust\",\n"
             "            \"version\": \"v0.1.0\"\n"
             "        }\n";
-        CFCParcel *parcel = CFCParcel_new_from_json(json, false);
+        CFCParcel *parcel = CFCParcel_new_from_json(json, NULL);
         OK(test, parcel != NULL, "new_from_json");
         CFCBase_decref((CFCBase*)parcel);
     }
 
     {
         const char *path = "t" CHY_DIR_SEP "cfbase" CHY_DIR_SEP "Animal.cfp";
-        CFCParcel *parcel = CFCParcel_new_from_file(path, false);
+        CFCParcel *parcel = CFCParcel_new_from_file(path, NULL);
         OK(test, parcel != NULL, "new_from_file");
         CFCBase_decref((CFCBase*)parcel);
     }
 
     {
-        CFCParcel *parcel = CFCParcel_new("Crustacean", "Crust", NULL, false);
+        CFCParcel *parcel = CFCParcel_new("Crustacean", "Crust", NULL, NULL);
         CFCParcel_register(parcel);
         STR_EQ(test, CFCVersion_get_vstring(CFCParcel_get_version(parcel)),
                "v0", "get_version");
@@ -138,7 +141,7 @@ S_run_parcel_tests(CFCTest *test) {
             "                \"Arthropod\": \"v30.104.5\"\n"
             "            }\n"
             "        }\n";
-        CFCParcel *parcel = CFCParcel_new_from_json(json, false);
+        CFCParcel *parcel = CFCParcel_new_from_json(json, NULL);
 
         CFCPrereq **prereqs = CFCParcel_get_prereqs(parcel);
         OK(test, prereqs != NULL, "prereqs");
@@ -169,12 +172,15 @@ S_run_parcel_tests(CFCTest *test) {
     }
 
     {
-        CFCParcel *foo = CFCParcel_new("Foo", NULL, NULL, true);
+        CFCFileSpec *foo_file_spec = CFCFileSpec_new(".", "Foo.cfp", true);
+        CFCParcel *foo = CFCParcel_new("Foo", NULL, NULL, foo_file_spec);
         CFCParcel_register(foo);
 
         CFCVersion *cfish_version = CFCVersion_new("v0.8.7");
+        CFCFileSpec *cfish_file_spec
+            = CFCFileSpec_new(".", "Clownfish.cfp", true);
         CFCParcel *cfish
-            = CFCParcel_new("Clownfish", NULL, cfish_version, true);
+            = CFCParcel_new("Clownfish", NULL, cfish_version, cfish_file_spec);
         CFCParcel_register(cfish);
 
         const char *crust_json =
@@ -185,7 +191,7 @@ S_run_parcel_tests(CFCTest *test) {
             "                \"Clownfish\": \"v0.8.5\",\n"
             "            }\n"
             "        }\n";
-        CFCParcel *crust = CFCParcel_new_from_json(crust_json, false);
+        CFCParcel *crust = CFCParcel_new_from_json(crust_json, NULL);
         CFCParcel_register(crust);
 
         CFCParcel_check_prereqs(crust);
@@ -217,7 +223,9 @@ S_run_parcel_tests(CFCTest *test) {
         FREEMEM(prereq_parcels);
         CFCBase_decref((CFCBase*)crust);
         CFCBase_decref((CFCBase*)cfish_version);
+        CFCBase_decref((CFCBase*)cfish_file_spec);
         CFCBase_decref((CFCBase*)cfish);
+        CFCBase_decref((CFCBase*)foo_file_spec);
         CFCBase_decref((CFCBase*)foo);
         CFCParcel_reap_singletons();
     }

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/c4b75803/compiler/src/CFCTestParser.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCTestParser.c b/compiler/src/CFCTestParser.c
index 9a0ccae..622dfff 100644
--- a/compiler/src/CFCTestParser.c
+++ b/compiler/src/CFCTestParser.c
@@ -55,7 +55,7 @@ S_run_tests(CFCTest *test) {
         CFCParcel *fish = CFCTest_parse_parcel(test, parser, "parcel Fish;");
 
         CFCParcel *registered
-            = CFCParcel_new("Crustacean", "Crust", NULL, false);
+            = CFCParcel_new("Crustacean", "Crust", NULL, NULL);
         CFCParcel_register(registered);
         CFCParcel *parcel
             = CFCTest_parse_parcel(test, parser, "parcel Crustacean;");

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/c4b75803/compiler/src/CFCTestSymbol.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCTestSymbol.c b/compiler/src/CFCTestSymbol.c
index 2fff530..fe1fbc3 100644
--- a/compiler/src/CFCTestSymbol.c
+++ b/compiler/src/CFCTestSymbol.c
@@ -36,7 +36,7 @@ const CFCTestBatch CFCTEST_BATCH_SYMBOL = {
 
 static void
 S_run_tests(CFCTest *test) {
-    CFCParcel *parcel = CFCParcel_new("Parcel", NULL, NULL, false);
+    CFCParcel *parcel = CFCParcel_new("Parcel", NULL, NULL, NULL);
 
     {
         static const char *exposures[4] = {
@@ -95,7 +95,7 @@ S_run_tests(CFCTest *test) {
 
     {
         CFCParcel *lucifer_parcel
-            = CFCParcel_new("Lucifer", NULL, NULL, false);
+            = CFCParcel_new("Lucifer", NULL, NULL, NULL);
         CFCParcel_register(lucifer_parcel);
         CFCSymbol *lucifer
             = CFCSymbol_new(lucifer_parcel, "parcel", NULL, NULL, "sym");
@@ -109,7 +109,7 @@ S_run_tests(CFCTest *test) {
         const char *PREFIX = CFCSymbol_get_PREFIX(lucifer);
         STR_EQ(test, PREFIX, "LUCIFER_", "get_PREFIX");
 
-        CFCParcel *luser_parcel = CFCParcel_new("Luser", NULL, NULL, false);
+        CFCParcel *luser_parcel = CFCParcel_new("Luser", NULL, NULL, NULL);
         CFCParcel_register(luser_parcel);
         CFCSymbol *luser
             = CFCSymbol_new(luser_parcel, "parcel", NULL, NULL, "sym");
@@ -133,7 +133,7 @@ S_run_tests(CFCTest *test) {
     }
 
     {
-        CFCParcel *eep_parcel = CFCParcel_new("Eep", NULL, NULL, false);
+        CFCParcel *eep_parcel = CFCParcel_new("Eep", NULL, NULL, NULL);
         CFCParcel_register(eep_parcel);
         CFCSymbol *eep
             = CFCSymbol_new(eep_parcel, "parcel", "Op::Ork", NULL, "ah_ah");

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/c4b75803/compiler/src/CFCTestType.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCTestType.c b/compiler/src/CFCTestType.c
index 167a497..fcbd444 100644
--- a/compiler/src/CFCTestType.c
+++ b/compiler/src/CFCTestType.c
@@ -79,7 +79,7 @@ S_run_tests(CFCTest *test) {
 
 static void
 S_run_basic_tests(CFCTest *test) {
-    CFCParcel *neato_parcel = CFCParcel_new("Neato", NULL, NULL, false);
+    CFCParcel *neato_parcel = CFCParcel_new("Neato", NULL, NULL, NULL);
     CFCParcel_register(neato_parcel);
     CFCType *type = CFCType_new(0, neato_parcel, "mytype_t", 0);
 
@@ -112,7 +112,7 @@ S_run_basic_tests(CFCTest *test) {
 
 static void
 S_run_primitive_tests(CFCTest *test) {
-    CFCParcel *parcel = CFCParcel_new("Parcel", NULL, NULL, false);
+    CFCParcel *parcel = CFCParcel_new("Parcel", NULL, NULL, NULL);
     CFCType *type = CFCType_new(CFCTYPE_PRIMITIVE, parcel, "hump_t", 0);
     OK(test, CFCType_is_primitive(type), "is_primitive");
 
@@ -328,7 +328,7 @@ S_run_object_tests(CFCTest *test) {
         CFCBase_decref((CFCBase*)parser);
     }
 
-    CFCParcel *neato_parcel = CFCParcel_new("Neato", NULL, NULL, false);
+    CFCParcel *neato_parcel = CFCParcel_new("Neato", NULL, NULL, NULL);
     CFCClass *foo_class
         = CFCClass_create(neato_parcel, NULL, "Foo", NULL, NULL, NULL, NULL,
                           NULL, false, false);
@@ -356,7 +356,7 @@ S_run_object_tests(CFCTest *test) {
 
     {
         CFCParcel *foreign_parcel
-            = CFCParcel_new("Foreign", NULL, NULL, false);
+            = CFCParcel_new("Foreign", NULL, NULL, NULL);
         CFCClass *foreign_foo_class
             = CFCClass_create(foreign_parcel, NULL, "Foreign::Foo", NULL, NULL,
                               NULL, NULL, NULL, false, false);
@@ -424,7 +424,7 @@ S_run_va_list_tests(CFCTest *test) {
 static void
 S_run_arbitrary_tests(CFCTest *test) {
     {
-        CFCParcel *neato_parcel = CFCParcel_new("Neato", NULL, NULL, false);
+        CFCParcel *neato_parcel = CFCParcel_new("Neato", NULL, NULL, NULL);
         CFCParcel_register(neato_parcel);
 
         CFCType *foo = CFCType_new_arbitrary(neato_parcel, "foo_t");
@@ -464,7 +464,7 @@ S_run_arbitrary_tests(CFCTest *test) {
 static void
 S_run_composite_tests(CFCTest *test) {
     CFCParser *parser = CFCParser_new();
-    CFCParcel *neato_parcel = CFCParcel_new("Neato", NULL, NULL, false);
+    CFCParcel *neato_parcel = CFCParcel_new("Neato", NULL, NULL, NULL);
     CFCParser_set_parcel(parser, neato_parcel);
 
     {

Reply via email to