You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2011/10/05 22:23:11 UTC

[lucy-commits] svn commit: r1179418 - in /incubator/lucy/branches/clownfish_lemon/clownfish: src/CFCLexHeader.l t/105-object_type.t

Author: marvin
Date: Wed Oct  5 20:23:11 2011
New Revision: 1179418

URL: http://svn.apache.org/viewvc?rev=1179418&view=rev
Log:
Fix parsing of type qualifiers.

Modified:
    incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCLexHeader.l
    incubator/lucy/branches/clownfish_lemon/clownfish/t/105-object_type.t

Modified: incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCLexHeader.l
URL: http://svn.apache.org/viewvc/incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCLexHeader.l?rev=1179418&r1=1179417&r2=1179418&view=diff
==============================================================================
--- incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCLexHeader.l (original)
+++ incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCLexHeader.l Wed Oct  5 20:23:11 2011
@@ -42,8 +42,12 @@ OBJECT_TYPE_SPECIFIER   ([a-z]+[a-z0-9]*
 %option yylineno
 
 %%
+const       { PARSE(CFC_TOKENTYPE_CONST, NULL); }
+nullable    { PARSE(CFC_TOKENTYPE_NULLABLE, NULL); } 
+incremented { PARSE(CFC_TOKENTYPE_INCREMENTED, NULL); } 
+decremented { PARSE(CFC_TOKENTYPE_DECREMENTED, NULL); } 
+
 void       { PARSE(CFC_TOKENTYPE_VOID, NULL); }
-const      { PARSE(CFC_TOKENTYPE_CONST, NULL); }
 float      { PARSE(CFC_TOKENTYPE_FLOAT, NULL); }
 double     { PARSE(CFC_TOKENTYPE_DOUBLE, NULL); }
 int8_t     { PARSE(CFC_TOKENTYPE_INT8_T, NULL); }

Modified: incubator/lucy/branches/clownfish_lemon/clownfish/t/105-object_type.t
URL: http://svn.apache.org/viewvc/incubator/lucy/branches/clownfish_lemon/clownfish/t/105-object_type.t?rev=1179418&r1=1179417&r2=1179418&view=diff
==============================================================================
--- incubator/lucy/branches/clownfish_lemon/clownfish/t/105-object_type.t (original)
+++ incubator/lucy/branches/clownfish_lemon/clownfish/t/105-object_type.t Wed Oct  5 20:23:11 2011
@@ -16,7 +16,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 57;
+use Test::More tests => 61;
 use Clownfish::Type;
 use Clownfish::Parser;
 
@@ -50,11 +50,16 @@ for my $specifier (qw( Foo FooJr FooIII 
     $type = $parser->parse("neato_$specifier*");
     ok( $type && $type->is_object, "neato_$specifier*" );
     $type = $parser->parse("const $specifier*");
-    ok( $type && $type->is_object, "const $specifier*" );
+    ok( $type && $type->is_object && $type->const, "const $specifier*" );
     $type = $parser->parse("incremented $specifier*");
-    ok( $type && $type->is_object, "incremented $specifier*" );
+    ok( $type && $type->is_object && $type->incremented,
+        "incremented $specifier*" );
     $type = $parser->parse("decremented $specifier*");
-    ok( $type && $type->is_object, "decremented $specifier*" );
+    ok( $type && $type->is_object && $type->decremented,
+        "decremented $specifier*" );
+    $type = $parser->parse("nullable $specifier*");
+    ok( $type && $type->is_object && $type->nullable,
+        "nullable $specifier*" );
 }
 
 eval { my $type = Clownfish::Type->new_object };