#290: whoops
authorDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Thu, 23 Apr 2009 18:08:25 +0000 (20:08 +0200)
committerDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Thu, 23 Apr 2009 18:08:25 +0000 (20:08 +0200)
Cython/Compiler/Parsing.py
tests/errors/e2_packedstruct_T290.pyx [new file with mode: 0644]

index 85919514a482d57dc0ffe08ceffc0684050856eb..8cc729977170f32c39cad02fc9890ca9320e29ae 100644 (file)
@@ -2168,7 +2168,7 @@ def p_c_struct_or_union_definition(s, pos, ctx):
     if s.systring == 'packed':
         packed = True
         s.next()
-        if s.sy != 'IDENT' and s.systring != 'struct':
+        if s.sy != 'IDENT' or s.systring != 'struct':
             s.expected('struct')
     # s.sy == ident 'struct' or 'union'
     kind = s.systring
diff --git a/tests/errors/e2_packedstruct_T290.pyx b/tests/errors/e2_packedstruct_T290.pyx
new file mode 100644 (file)
index 0000000..ee053ee
--- /dev/null
@@ -0,0 +1,6 @@
+cdef packed foo:
+    pass
+
+_ERRORS = u"""
+1:12: Expected 'struct'
+"""