Commits

Armin Ronacher committed afa2a41

Added support for noexcept specifiers

  • Participants
  • Parent commits b7c1247

Comments (0)

Files changed (2)

File sphinx/domains/cpp.py

 class FuncDefExpr(NamedDefExpr):
 
     def __init__(self, name, visibility, static, explicit, constexpr, rv,
-                 signature, const, pure_virtual):
+                 signature, const, noexcept, pure_virtual):
         NamedDefExpr.__init__(self, name, visibility, static)
         self.rv = rv
         self.signature = signature
         self.explicit = explicit
         self.constexpr = constexpr
         self.const = const
+        self.noexcept = noexcept
         self.pure_virtual = pure_virtual
 
     def get_id(self):
             map(unicode, self.signature))))
         if self.const:
             buf.append(u'const')
+        if self.noexcept:
+            buf.append(u'noexcept')
         if self.pure_virtual:
             buf.append(u'= 0')
         return u' '.join(buf)
             args.append(ArgumentDefExpr(argtype, argname, default))
         self.skip_ws()
         const = self.skip_word_and_ws('const')
+        noexcept = self.skip_word_and_ws('noexcept')
         if self.skip_string('='):
             self.skip_ws()
             if not (self.skip_string('0') or \
             pure_virtual = True
         else:
             pure_virtual = False
-        return args, const, pure_virtual
+        return args, const, noexcept, pure_virtual
 
     def _parse_visibility_static(self):
         visibility = 'public'

File tests/test_cpp_domain.py

     x = 'constexpr int get_value()'
     assert unicode(parse('function', x)) == x
 
+    x = 'int get_value() const noexcept'
+    assert unicode(parse('function', x)) == x
+
 
 def test_operators():
     x = parse('function', 'void operator new [  ] ()')