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 02:24:49 UTC

[lucy-commits] svn commit: r1179018 - in /incubator/lucy/branches/clownfish_lemon/clownfish: src/CFCLexHeader.l src/CFCParseHeader.y t/106-va_list_type.t

Author: marvin
Date: Wed Oct  5 00:24:49 2011
New Revision: 1179018

URL: http://svn.apache.org/viewvc?rev=1179018&view=rev
Log:
Add support for va_list type.

Modified:
    incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCLexHeader.l
    incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCParseHeader.y
    incubator/lucy/branches/clownfish_lemon/clownfish/t/106-va_list_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=1179018&r1=1179017&r2=1179018&view=diff
==============================================================================
--- incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCLexHeader.l (original)
+++ incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCLexHeader.l Wed Oct  5 00:24:49 2011
@@ -46,5 +46,6 @@ int        { PARSE(CFC_TOKENTYPE_INT, NU
 long       { PARSE(CFC_TOKENTYPE_LONG, NULL); }
 size_t     { PARSE(CFC_TOKENTYPE_SIZE_T, NULL); }
 bool_t     { PARSE(CFC_TOKENTYPE_BOOL_T, NULL); }
+va_list    { PARSE(CFC_TOKENTYPE_VA_LIST, NULL); }
 %%
 

Modified: incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCParseHeader.y
URL: http://svn.apache.org/viewvc/incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCParseHeader.y?rev=1179018&r1=1179017&r2=1179018&view=diff
==============================================================================
--- incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCParseHeader.y (original)
+++ incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCParseHeader.y Wed Oct  5 00:24:49 2011
@@ -62,6 +62,7 @@ result ::= simple_type(A).
 simple_type(A) ::= void_type(B).    { A = B; }
 simple_type(A) ::= float_type(B).   { A = B; }
 simple_type(A) ::= integer_type(B). { A = B; }
+simple_type(A) ::= va_list_type(B). { A = B; }
 
 void_type(A) ::= CONST void_type_specifier.
 {
@@ -79,6 +80,7 @@ void_type(A) ::= void_type_specifier.
 %destructor integer_type_specifier      { }
 
 void_type_specifier ::= VOID.
+va_list_specifier         ::= VA_LIST.
 integer_type_specifier(A) ::= INT8_T.    { A = KW_INT8_T; }
 integer_type_specifier(A) ::= INT16_T.   { A = KW_INT16_T; }
 integer_type_specifier(A) ::= INT32_T.   { A = KW_INT32_T; }
@@ -116,3 +118,8 @@ float_type(A) ::= CONST float_type_speci
     A = (CFCBase*)CFCType_new_float(CFCTYPE_CONST, B);
 }
 
+va_list_type(A) ::= va_list_specifier.
+{
+    A = (CFCBase*)CFCType_new_va_list();
+}
+

Modified: incubator/lucy/branches/clownfish_lemon/clownfish/t/106-va_list_type.t
URL: http://svn.apache.org/viewvc/incubator/lucy/branches/clownfish_lemon/clownfish/t/106-va_list_type.t?rev=1179018&r1=1179017&r2=1179018&view=diff
==============================================================================
--- incubator/lucy/branches/clownfish_lemon/clownfish/t/106-va_list_type.t (original)
+++ incubator/lucy/branches/clownfish_lemon/clownfish/t/106-va_list_type.t Wed Oct  5 00:24:49 2011
@@ -16,7 +16,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 5;
+use Test::More tests => 4;
 use Clownfish::Type;
 use Clownfish::Parser;
 
@@ -27,11 +27,12 @@ is( $va_list_type->to_c, "va_list", "to_
 
 my $parser = Clownfish::Parser->new;
 
-is( $parser->va_list_type_specifier('va_list'),
-    'va_list', 'va_list_type_specifier' );
-my $type = $parser->va_list_type('va_list');
+my $type = $parser->parse('va_list');
 ok( $type && $type->is_va_list, "parse va_list" );
-ok( !$parser->va_list_type_specifier('va_listable'),
-    "va_list_type_specifier guards against partial word matches"
-);
+TODO: {
+    local $TODO = "No word boundaries in lex";
+    ok( !$parser->va_list_type_specifier('va_listable'),
+        "va_list_type_specifier guards against partial word matches"
+    );
+}