Skip to content

Commit

Permalink
Merge pull request #191 from rakhimov/union
Browse files Browse the repository at this point in the history
Add C/C++ 'union' to full function qualification
  • Loading branch information
terryyin authored Jun 29, 2017
2 parents 48de756 + ae8c550 commit 154eaa8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lizard_languages/clike.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def _state_global(self, token):
if token == "template":
self._state = self._template_declaration

elif token in ("struct", "class", "namespace"):
elif token in ("struct", "class", "namespace", "union"):
self._state = self._read_namespace

elif token == "{":
Expand Down
5 changes: 5 additions & 0 deletions test/test_languages/testCAndCPP.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,11 @@ def test_ref_qualifiers(self):
self.assertEqual(1, len(result))
self.assertEqual("A::foo", result[0].name)

def test_union_as_qualifier(self):
"""Union as namespace for functions."""
result = get_cpp_function_list("union A { void foo() {} };")
self.assertEqual(1, len(result))
self.assertEqual("A::foo", result[0].name)

class Test_cpp11_Attributes(unittest.TestCase):
"""C++11 extendable attributes can appear pretty much anywhere."""
Expand Down

0 comments on commit 154eaa8

Please sign in to comment.