Use string literals for namespace (rather than dotted names).
authorRobert Bradshaw <robertwb@math.washington.edu>
Sat, 20 Feb 2010 04:47:58 +0000 (20:47 -0800)
committerRobert Bradshaw <robertwb@math.washington.edu>
Sat, 20 Feb 2010 04:47:58 +0000 (20:47 -0800)
Cython/Compiler/Parsing.py
tests/run/cpp_classes.pyx
tests/run/cpp_stl.pyx
tests/run/cpp_stl_vector.pyx

index 20ed8eb08a73a075ff78eb0e8662016b3b752c77..8ca741baa4243a91a9e71cf7f4b08c1c0dcf390b 100644 (file)
@@ -2278,7 +2278,7 @@ def p_cdef_extern_block(s, pos, ctx):
         _, include_file = p_string_literal(s)
     if s.systring == "namespace":
         s.next()
-        ctx.namespace = p_dotted_name(s, as_allowed=False)[2].replace('.', '::')
+        ctx.namespace = p_string_literal(s)[1]
     ctx = ctx(cdef_flag = 1, visibility = 'extern')
     if p_nogil(s):
         ctx.nogil = 1
index 438e3ffab867b0be4b2d28c518808ef63fe8c22a..8ddcba1ae7e379d02d70835f7321c367f2693cc8 100644 (file)
@@ -7,7 +7,7 @@ __doc__ = u"""
     (225.0, 225.0)
 """
 
-cdef extern from "shapes.h" namespace shapes:
+cdef extern from "shapes.h" namespace "shapes":
 
     cdef cppclass Shape:
         float area()
index 4b8af28a576edea99f408031947944e318124f02..93a442af4fdccb27204a7f0c5f939d30a5c680f5 100644 (file)
@@ -5,7 +5,7 @@ __doc__ = u"""
     100
 """
 
-cdef extern from "vector" namespace std:
+cdef extern from "vector" namespace "std":
 
     cdef cppclass iterator[T]:
         pass
index f6a81b57b0144b217bed75b1a924005fd68176eb..159d2bd0f74766c19d3d3eca3d8efe32222dd8bb 100644 (file)
@@ -1,4 +1,4 @@
-cdef extern from "<vector>" namespace std:
+cdef extern from "<vector>" namespace "std":
 
     cdef cppclass vector[T]:
         void push_back(T)