Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r152:f9f839119f6e
Date: 2014-12-04 22:42 +0100
http://bitbucket.org/cffi/creflect/changeset/f9f839119f6e/

Log:    Accept (and ignore) variable names after "long" (they were already
        accepted after "int")

diff --git a/creflect/creflect_cdecl.c b/creflect/creflect_cdecl.c
--- a/creflect/creflect_cdecl.c
+++ b/creflect/creflect_cdecl.c
@@ -444,7 +444,6 @@
         case TOK_VOID:
         case TOK__BOOL:
         case TOK_FLOAT:
-        case TOK_IDENTIFIER:
         case TOK_STRUCT:
         case TOK_UNION:
             parse_error(tok, "invalid combination of types");
diff --git a/creflect/test/test_c_decl_parser.py 
b/creflect/test/test_c_decl_parser.py
--- a/creflect/test/test_c_decl_parser.py
+++ b/creflect/test/test_c_decl_parser.py
@@ -43,6 +43,8 @@
     parse("unsigned int", "unsigned int")
     parse("long", "long")
     parse("long int", "long")
+    parse("long int a", "long")
+    parse("long a", "long")
     parse("short int", "short")
     parse("long long int", "long long")
     parse("unsigned long long *", "PTR unsigned long long")
@@ -82,7 +84,7 @@
     parse_error("long char", "invalid combination of types", 5)
     parse_error("short char", "invalid combination of types", 6)
     parse_error("signed void", "invalid combination of types", 7)
-    parse_error("unsigned foobar_t", "invalid combination of types", 9)
+    parse_error("unsigned struct", "invalid combination of types", 9)
     #
     parse_error("", "identifier expected", 0)
     parse_error("]", "identifier expected", 0)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to