Commit da38498e authored by Robert Bradshaw's avatar Robert Bradshaw

Use string literals for namespace (rather than dotted names).

parent b978c7e0
...@@ -2278,7 +2278,7 @@ def p_cdef_extern_block(s, pos, ctx): ...@@ -2278,7 +2278,7 @@ def p_cdef_extern_block(s, pos, ctx):
_, include_file = p_string_literal(s) _, include_file = p_string_literal(s)
if s.systring == "namespace": if s.systring == "namespace":
s.next() 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') ctx = ctx(cdef_flag = 1, visibility = 'extern')
if p_nogil(s): if p_nogil(s):
ctx.nogil = 1 ctx.nogil = 1
......
...@@ -7,7 +7,7 @@ __doc__ = u""" ...@@ -7,7 +7,7 @@ __doc__ = u"""
(225.0, 225.0) (225.0, 225.0)
""" """
cdef extern from "shapes.h" namespace shapes: cdef extern from "shapes.h" namespace "shapes":
cdef cppclass Shape: cdef cppclass Shape:
float area() float area()
......
...@@ -5,7 +5,7 @@ __doc__ = u""" ...@@ -5,7 +5,7 @@ __doc__ = u"""
100 100
""" """
cdef extern from "vector" namespace std: cdef extern from "vector" namespace "std":
cdef cppclass iterator[T]: cdef cppclass iterator[T]:
pass pass
......
cdef extern from "<vector>" namespace std: cdef extern from "<vector>" namespace "std":
cdef cppclass vector[T]: cdef cppclass vector[T]:
void push_back(T) void push_back(T)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment