From 14539f947b2c0c3c0c150ddb04e37f5ac645b59e Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Mon, 20 Sep 2021 06:26:00 -0700 Subject: Clean up some comments --- pycparser/c_parser.py | 4 ++-- tests/test_c_generator.py | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/pycparser/c_parser.py b/pycparser/c_parser.py index 0f026eb..f9528f8 100644 --- a/pycparser/c_parser.py +++ b/pycparser/c_parser.py @@ -779,8 +779,8 @@ class CParser(PLYParser): """ p[0] = self._add_declaration_specifier(p[2], p[1], 'function') - # This is a bit ugly, but we need to process atomic specifier before qualifiers - # for _Atomic(x) in typedefs. + # Withot this, `typedef _Atomic(T) U` will parse incorrectly because the + # _Atomic qualifier will match, instead of the specifier. def p_declaration_specifiers_no_type_4(self, p): """ declaration_specifiers_no_type : atomic_specifier declaration_specifiers_no_type_opt """ diff --git a/tests/test_c_generator.py b/tests/test_c_generator.py index bcbdfcc..fb9499a 100644 --- a/tests/test_c_generator.py +++ b/tests/test_c_generator.py @@ -368,10 +368,6 @@ class TestCtoC(unittest.TestCase): 'const int') def test_atomic_qual(self): - #s = '_Atomic(_Atomic(int)*) x;' - #ast = parse_to_ast(s) - #print(c_generator.CGenerator().visit(ast)) - self._assert_ctoc_correct('_Atomic int x;') self._assert_ctoc_correct('_Atomic int* x;') self._assert_ctoc_correct('int* _Atomic x;') @@ -392,7 +388,7 @@ class TestCtoC(unittest.TestCase): self.assertEqual(c3, '_Atomic int * _Atomic x;\n') self._assert_ctoc_correct(s3) - # FIXME: Regeneration with multiple qualifiers is not fully supported. + # TODO: Regeneration with multiple qualifiers is not fully supported. # REF: https://github.com/eliben/pycparser/issues/433 # self._assert_ctoc_correct('auto const _Atomic(int *) a;') -- cgit v1.2.1