lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [lucy-commits] svn commit: r1337997 - in /lucy/trunk/clownfish: perl/t/600-parser.t src/CFCParseHeader.y
Date Sun, 13 May 2012 22:34:12 GMT
Author: marvin
Date: Sun May 13 22:34:11 2012
New Revision: 1337997

URL: http://svn.apache.org/viewvc?rev=1337997&view=rev
Log:
Remove cnick from parcel syntax in cfh files.

Remove the ability to set a Parcel's nickname during a parcel
declaration, so that a parcel declaration is now more like a forward
struct declaration in C.  Now the only way to set the nickname is via a
parcel definition in a .cfp file.

Modified:
    lucy/trunk/clownfish/perl/t/600-parser.t
    lucy/trunk/clownfish/src/CFCParseHeader.y

Modified: lucy/trunk/clownfish/perl/t/600-parser.t
URL: http://svn.apache.org/viewvc/lucy/trunk/clownfish/perl/t/600-parser.t?rev=1337997&r1=1337996&r2=1337997&view=diff
==============================================================================
--- lucy/trunk/clownfish/perl/t/600-parser.t (original)
+++ lucy/trunk/clownfish/perl/t/600-parser.t Sun May 13 22:34:11 2012
@@ -28,15 +28,16 @@ isa_ok(
     "Clownfish::CFC::Model::Parcel",
     "parcel_definition"
 );
-isa_ok(
-    $parser->parse("parcel Crustacean cnick Crust;"),
-    "Clownfish::CFC::Model::Parcel",
-    "parcel_definition with cnick"
-);
 
 # Set and leave parcel.
-my $parcel = $parser->parse('parcel Crustacean cnick Crust;')
+my $registered = Clownfish::CFC::Model::Parcel->new(
+    name  => 'Crustacean',
+    cnick => 'Crust',
+);
+$registered->register;
+my $parcel = $parser->parse('parcel Crustacean;')
     or die "failed to process parcel_definition";
+is( $$parcel, $$registered, "Fetch registered parcel" );
 is( ${ $parser->get_parcel },
     $$parcel, "parcel_definition sets internal \$parcel var" );
 

Modified: lucy/trunk/clownfish/src/CFCParseHeader.y
URL: http://svn.apache.org/viewvc/lucy/trunk/clownfish/src/CFCParseHeader.y?rev=1337997&r1=1337996&r2=1337997&view=diff
==============================================================================
--- lucy/trunk/clownfish/src/CFCParseHeader.y (original)
+++ lucy/trunk/clownfish/src/CFCParseHeader.y Sun May 13 22:34:11 2012
@@ -329,21 +329,6 @@ parcel_definition(A) ::= exposure_specif
     CFCParser_set_parcel(state, A);
 }
 
-parcel_definition(A) ::= exposure_specifier(B) qualified_id(C) cnick(D) SEMICOLON.
-{
-    if (strcmp(B, "parcel") != 0) {
-         CFCUtil_die("A syntax error was detected when parsing '%s'", B);
-    }
-    A = CFCParcel_fetch(C);
-    if (!A) {
-        A = CFCParcel_new(C, D);
-        CFCParcel_register(A);
-        CFCBase_decref((CFCBase*)A);
-    }
-    CFCBase_incref((CFCBase*)A);
-    CFCParser_set_parcel(state, A);
-}
-
 class_declaration(A) ::= class_defs(B) RIGHT_CURLY_BRACE.
 {
     A = B;



Mime
View raw message