Repository: eerimoq/asn1tools (language: python)

Issue:
Test failures with pyparsing 3.1.1
Hi,

with asn1tools 0.166.0 we are seeing the test suite fail after upgrading pyparsing from 3.0.9 to 3.1.1.

```
FAILED tests/test_parse.py::Asn1ToolsParseTest::test_parse_error_begin_missing - AssertionError: "Inva[20 chars]line 1, column 19: 'A DEFINITIONS ::= >!<END...
FAILED tests/test_parse.py::Asn1ToolsParseTest::test_parse_error_definitive_identifier - AssertionError: "Inva[70 chars]ND': ." != "Inva[70 chars]ND': Expected {{id...
FAILED tests/test_parse.py::Asn1ToolsParseTest::test_parse_error_empty_string - AssertionError: "Invalid ASN.1 syntax at line 1, column 1: '>!<': ." != "In...
FAILED tests/test_parse.py::Asn1ToolsParseTest::test_parse_error_end_missing - AssertionError: "Inva[20 chars]line 1, column 24: 'A DEFINITIONS ::= BEGIN>...
FAILED tests/test_parse.py::Asn1ToolsParseTest::test_parse_error_end_missing_with_comments - AssertionError: "Invalid ASN.1 syntax at line 3, column 11: '::= BEGIN >!<'...
FAILED tests/test_parse.py::Asn1ToolsParseTest::test_parse_error_late_extension_additions - AssertionError: "Inva[83 chars]a BOOLEAN, ..., ...>!<, [[ c BOOLEAN ]] } EN...
FAILED tests/test_parse.py::Asn1ToolsParseTest::test_parse_error_missing_type - AssertionError: "Inva[31 chars]umn 31: 'A DEFINITIONS ::= BEGIN B ::= >!<EN...
FAILED tests/test_parse.py::Asn1ToolsParseTest::test_parse_error_missing_union_member_beginning - AssertionError: "Inva[30 chars]lumn 40: 'A DEFINITIONS ::= BEGIN B ::= INTE...
FAILED tests/test_parse.py::Asn1ToolsParseTest::test_parse_error_missing_union_member_end - AssertionError: "Inva[30 chars]lumn 49: 'A DEFINITIONS ::= BEGIN B ::= INTE...
FAILED tests/test_parse.py::Asn1ToolsParseTest::test_parse_error_missing_union_member_middle - AssertionError: "Inva[30 chars]lumn 49: 'A DEFINITIONS ::= BEGIN B ::= INTE...
FAILED tests/test_parse.py::Asn1ToolsParseTest::test_parse_error_sequence_missing_member_name - AssertionError: "Inva[47 chars]ITIONS ::= BEGIN  A ::= SEQUENCE { >!<A } EN...
FAILED tests/test_parse.py::Asn1ToolsParseTest::test_parse_error_sequence_missing_type - AssertionError: "Inva[31 chars]umn 45: 'A DEFINITIONS ::= BEGIN  A ::= SEQU...
FAILED tests/test_parse.py::Asn1ToolsParseTest::test_parse_error_size_constraint_missing_parentheses - AssertionError: "Inva[46 chars]NITIONS ::= BEGIN B ::= INTEGER (SIZE >!<1)E...
FAILED tests/test_parse.py::Asn1ToolsParseTest::test_parse_error_size_constraint_missing_size - AssertionError: "Inva[67 chars]:= INTEGER (SIZE (>!<))END': ." != "Inva[67 ...
FAILED tests/test_parse.py::Asn1ToolsParseTest::test_parse_error_tag_class_number_missing - AssertionError: "Inva[49 chars]IONS ::= BEGIN B ::= [>!<] INTEGER END': ." ...
FAILED tests/test_parse.py::Asn1ToolsParseTest::test_parse_error_too_many_extension_markers - AssertionError: "Inva[117 chars][[ c BOOLEAN ]], ..., d BOOLEAN>!<, ... } E...
FAILED tests/test_parse.py::Asn1ToolsParseTest::test_parse_error_type_assignment_missing_assignment - AssertionError: "Inva[26 chars], column 27: 'A DEFINITIONS ::= BEGIN A >!<E...
FAILED tests/test_parse.py::Asn1ToolsParseTest::test_parse_error_value_assignment_missing_assignment - AssertionError: "Inva[34 chars] 35: 'A DEFINITIONS ::= BEGIN a INTEGER >!<E...
```

```
asn1tools> ============================= test session starts ==============================
asn1tools> platform linux -- Python 3.11.5, pytest-7.4.2, pluggy-1.2.0
asn1tools> rootdir: /build/source
asn1tools> collected 493 items                                                            
asn1tools> 
asn1tools> tests/test_ber.py ...................................................... [ 10%]
asn1tools> ...                                                                      [ 11%]
asn1tools> tests/test_c_source.py .................                                 [ 15%]
asn1tools> tests/test_codecs.py .........                                           [ 16%]
asn1tools> tests/test_codecs_consistency.py ....................................... [ 24%]
asn1tools> ....                                                                     [ 25%]
asn1tools> tests/test_command_line.py ...................                           [ 29%]
asn1tools> tests/test_compile.py .......................                            [ 34%]
asn1tools> tests/test_constraints_checker.py .................                      [ 37%]
asn1tools> tests/test_der.py .................                                      [ 40%]
asn1tools> tests/test_gser.py ...........................                           [ 46%]
asn1tools> tests/test_jer.py .......................                                [ 51%]
asn1tools> tests/test_oer.py ................................                       [ 57%]
asn1tools> tests/test_parse.py .........FFFFFF..FFFF.FFFFFFFF...................... [ 68%]
asn1tools> .........................                                                [ 73%]
asn1tools> tests/test_per.py ....................................                   [ 80%]
asn1tools> tests/test_two_modules.py .                                              [ 80%]
asn1tools> tests/test_type_checker.py ...........................                   [ 86%]
asn1tools> tests/test_uper.py ............................................          [ 95%]
asn1tools> tests/test_xer.py ........................                               [100%]
asn1tools> 
asn1tools> =================================== FAILURES ===================================
asn1tools> ______________ Asn1ToolsParseTest.test_parse_error_begin_missing _______________
asn1tools> 
asn1tools> self = <tests.test_parse.Asn1ToolsParseTest testMethod=test_parse_error_begin_missing>
asn1tools> 
asn1tools>     def test_parse_error_begin_missing(self):
asn1tools>         with self.assertRaises(asn1tools.ParseError) as cm:
asn1tools>             asn1tools.parse_string('A DEFINITIONS ::= END')
asn1tools>     
asn1tools> >       self.assertEqual(str(cm.exception),
asn1tools>                          "Invalid ASN.1 syntax at line 1, column 19: "
asn1tools>                          "'A DEFINITIONS ::= >!<END': Expected BEGIN.")
asn1tools> E       AssertionError: "Inva[20 chars]line 1, column 19: 'A DEFINITIONS ::= >!<END': ." != "Inva[20 chars]line 1, column 19: 'A DEFINITIONS ::= >!<END': Expected BEGIN."
asn1tools> E       - Invalid ASN.1 syntax at line 1, column 19: 'A DEFINITIONS ::= >!<END': .
asn1tools> E       + Invalid ASN.1 syntax at line 1, column 19: 'A DEFINITIONS ::= >!<END': Expected BEGIN.
asn1tools> E       ?                                                                        ++++++++++++++
asn1tools> 
asn1tools> tests/test_parse.py:297: AssertionError
asn1tools> __________ Asn1ToolsParseTest.test_parse_error_definitive_identifier ___________
asn1tools> 
asn1tools> self = <tests.test_parse.Asn1ToolsParseTest testMethod=test_parse_error_definitive_identifier>
asn1tools> 
asn1tools>     def test_parse_error_definitive_identifier(self):
asn1tools>         with self.assertRaises(asn1tools.ParseError) as cm:
asn1tools>             asn1tools.parse_string('A {} DEFINITIONS ::= BEGIN '
asn1tools>                                    'END')
asn1tools>     
asn1tools> >       self.assertEqual(
asn1tools>             str(cm.exception),
asn1tools>             "Invalid ASN.1 syntax at line 1, column 4: 'A {>!<} DEFINITIONS "
asn1tools>             "::= BEGIN END': Expected {{identifier Suppress:('(') - "
asn1tools>             "definitiveNumberForm - Suppress:(')')} | identifier | "
asn1tools>             "definitiveNumberForm}.")
asn1tools> E       AssertionError: "Inva[70 chars]ND': ." != "Inva[70 chars]ND': Expected {{identifier Suppress:('(') - de[70 chars]rm}."
asn1tools> E       - Invalid ASN.1 syntax at line 1, column 4: 'A {>!<} DEFINITIONS ::= BEGIN END': .
asn1tools> E       + Invalid ASN.1 syntax at line 1, column 4: 'A {>!<} DEFINITIONS ::= BEGIN END': Expected {{identifier Suppress:('(') - definitiveNumberForm - Suppress:(')')} | identifier | definitiveNumberForm}.
asn1tools> 
asn1tools> tests/test_parse.py:354: AssertionError
asn1tools> _______________ Asn1ToolsParseTest.test_parse_error_empty_string _______________
asn1tools> 
asn1tools> self = <tests.test_parse.Asn1ToolsParseTest testMethod=test_parse_error_empty_string>
asn1tools> 
asn1tools>     def test_parse_error_empty_string(self):
asn1tools>         with self.assertRaises(asn1tools.ParseError) as cm:
asn1tools>             asn1tools.parse_string('')
asn1tools>     
asn1tools> >       self.assertEqual(str(cm.exception),
asn1tools>                          "Invalid ASN.1 syntax at line 1, column 1: '>!<': "
asn1tools>                          "Expected modulereference.")
asn1tools> E       AssertionError: "Invalid ASN.1 syntax at line 1, column 1: '>!<': ." != "Invalid ASN.1 syntax at line 1, column 1: '>!<': Expected modulereference."
asn1tools> E       - Invalid ASN.1 syntax at line 1, column 1: '>!<': .
asn1tools> E       + Invalid ASN.1 syntax at line 1, column 1: '>!<': Expected modulereference.
asn1tools> E       ?                                                  ++++++++++++++++++++++++
asn1tools> 
asn1tools> tests/test_parse.py:289: AssertionError
asn1tools> _______________ Asn1ToolsParseTest.test_parse_error_end_missing ________________
asn1tools> 
asn1tools> self = <tests.test_parse.Asn1ToolsParseTest testMethod=test_parse_error_end_missing>
asn1tools> 
asn1tools>     def test_parse_error_end_missing(self):
asn1tools>         with self.assertRaises(asn1tools.ParseError) as cm:
asn1tools>             asn1tools.parse_string('A DEFINITIONS ::= BEGIN')
asn1tools>     
asn1tools> >       self.assertEqual(str(cm.exception),
asn1tools>                          "Invalid ASN.1 syntax at line 1, column 24: "
asn1tools>                          "'A DEFINITIONS ::= BEGIN>!<': Expected END.")
asn1tools> E       AssertionError: "Inva[20 chars]line 1, column 24: 'A DEFINITIONS ::= BEGIN>!<': ." != "Inva[20 chars]line 1, column 24: 'A DEFINITIONS ::= BEGIN>!<': Expected END."
asn1tools> E       - Invalid ASN.1 syntax at line 1, column 24: 'A DEFINITIONS ::= BEGIN>!<': .
asn1tools> E       + Invalid ASN.1 syntax at line 1, column 24: 'A DEFINITIONS ::= BEGIN>!<': Expected END.
asn1tools> E       ?                                                                          ++++++++++++
asn1tools> 
asn1tools> tests/test_parse.py:305: AssertionError
asn1tools> ________ Asn1ToolsParseTest.test_parse_error_end_missing_with_comments _________
asn1tools> 
asn1tools> self = <tests.test_parse.Asn1ToolsParseTest testMethod=test_parse_error_end_missing_with_comments>
asn1tools> 
asn1tools>     def test_parse_error_end_missing_with_comments(self):
asn1tools>         with self.assertRaises(asn1tools.ParseError) as cm:
asn1tools>             asn1tools.parse_string('A DEFINITIONS -- g -- \n'
asn1tools>                                    '-- hhhh\n'
asn1tools>                                    '::= BEGIN ')
asn1tools>     
asn1tools> >       self.assertEqual(str(cm.exception),
asn1tools>                          "Invalid ASN.1 syntax at line 3, column 11: "
asn1tools>                          "'::= BEGIN >!<': Expected END.")
asn1tools> E       AssertionError: "Invalid ASN.1 syntax at line 3, column 11: '::= BEGIN >!<': ." != "Invalid ASN.1 syntax at line 3, column 11: '::= BEGIN >!<': Expected END."
asn1tools> E       - Invalid ASN.1 syntax at line 3, column 11: '::= BEGIN >!<': .
asn1tools> E       + Invalid ASN.1 syntax at line 3, column 11: '::= BEGIN >!<': Expected END.
asn1tools> E       ?                                                             ++++++++++++
asn1tools> 
asn1tools> tests/test_parse.py:445: AssertionError
asn1tools> _________ Asn1ToolsParseTest.test_parse_error_late_extension_additions _________
asn1tools> 
asn1tools> self = <tests.test_parse.Asn1ToolsParseTest testMethod=test_parse_error_late_extension_additions>
asn1tools> 
asn1tools>     def test_parse_error_late_extension_additions(self):
asn1tools>         with self.assertRaises(asn1tools.ParseError) as cm:
asn1tools>             asn1tools.parse_string('A DEFINITIONS ::= BEGIN '
asn1tools>                                    'Foo ::= SEQUENCE { '
asn1tools>                                    'a BOOLEAN, '
asn1tools>                                    '..., '
asn1tools>                                    '..., '
asn1tools>                                    '[[ '
asn1tools>                                    'c BOOLEAN '
asn1tools>                                    ']] '
asn1tools>                                    '} '
asn1tools>                                    'END')
asn1tools>     
asn1tools> >       self.assertEqual(
asn1tools>             str(cm.exception),
asn1tools>             "Invalid ASN.1 syntax at line 1, column 63: \'A DEFINITIONS ::= "
asn1tools>             "BEGIN Foo ::= SEQUENCE { a BOOLEAN, ..., ...>!<, [[ c BOOLEAN ]] "
asn1tools>             "} END\': Expected Type.")
asn1tools> E       AssertionError: "Inva[83 chars]a BOOLEAN, ..., ...>!<, [[ c BOOLEAN ]] } END': ." != "Inva[83 chars]a BOOLEAN, ..., ...>!<, [[ c BOOLEAN ]] } END': Expected Type."
asn1tools> E       - Invalid ASN.1 syntax at line 1, column 63: 'A DEFINITIONS ::= BEGIN Foo ::= SEQUENCE { a BOOLEAN, ..., ...>!<, [[ c BOOLEAN ]] } END': .
asn1tools> E       + Invalid ASN.1 syntax at line 1, column 63: 'A DEFINITIONS ::= BEGIN Foo ::= SEQUENCE { a BOOLEAN, ..., ...>!<, [[ c BOOLEAN ]] } END': Expected Type.
asn1tools> E       ?                                                                                                                                        +++++++++++++
asn1tools> 
asn1tools> tests/test_parse.py:462: AssertionError
asn1tools> _______________ Asn1ToolsParseTest.test_parse_error_missing_type _______________
asn1tools> 
asn1tools> self = <tests.test_parse.Asn1ToolsParseTest testMethod=test_parse_error_missing_type>
asn1tools> 
asn1tools>     def test_parse_error_missing_type(self):
asn1tools>         with self.assertRaises(asn1tools.ParseError) as cm:
asn1tools>             asn1tools.parse_string('A DEFINITIONS ::= BEGIN '
asn1tools>                                    'B ::= '
asn1tools>                                    'END')
asn1tools>     
asn1tools> >       self.assertEqual(
asn1tools>             str(cm.exception),
asn1tools>             "Invalid ASN.1 syntax at line 1, column 31: 'A DEFINITIONS ::= BEGIN "
asn1tools>             "B ::= >!<END': Expected Type.")
asn1tools> E       AssertionError: "Inva[31 chars]umn 31: 'A DEFINITIONS ::= BEGIN B ::= >!<END': ." != "Inva[31 chars]umn 31: 'A DEFINITIONS ::= BEGIN B ::= >!<END': Expected Type."
asn1tools> E       - Invalid ASN.1 syntax at line 1, column 31: 'A DEFINITIONS ::= BEGIN B ::= >!<END': .
asn1tools> E       + Invalid ASN.1 syntax at line 1, column 31: 'A DEFINITIONS ::= BEGIN B ::= >!<END': Expected Type.
asn1tools> E       ?                                                                                    +++++++++++++
asn1tools> 
asn1tools> tests/test_parse.py:434: AssertionError
asn1tools> ______ Asn1ToolsParseTest.test_parse_error_missing_union_member_beginning ______
asn1tools> 
asn1tools> self = <tests.test_parse.Asn1ToolsParseTest testMethod=test_parse_error_missing_union_member_beginning>
asn1tools> 
asn1tools>     def test_parse_error_missing_union_member_beginning(self):
asn1tools>         with self.assertRaises(asn1tools.ParseError) as cm:
asn1tools>             asn1tools.parse_string('A DEFINITIONS ::= BEGIN '
asn1tools>                                    'B ::= INTEGER (| SIZE (1))'
asn1tools>                                    'END')
asn1tools>     
asn1tools> >       self.assertEqual(
asn1tools>             str(cm.exception),
asn1tools>             "Invalid ASN.1 syntax at line 1, column 39: 'A DEFINITIONS ::= BEGIN "
asn1tools>             "B ::= INTEGER >!<(| SIZE (1))END': Expected END.")
asn1tools> E       AssertionError: "Inva[30 chars]lumn 40: 'A DEFINITIONS ::= BEGIN B ::= INTEGE[20 chars]': ." != "Inva[30 chars]lumn 39: 'A DEFINITIONS ::= BEGIN B ::= INTEGE[32 chars]END."
asn1tools> E       - Invalid ASN.1 syntax at line 1, column 40: 'A DEFINITIONS ::= BEGIN B ::= INTEGER (>!<| SIZE (1))END': .
asn1tools> E       ?                                        ^^                                         -
asn1tools> E       + Invalid ASN.1 syntax at line 1, column 39: 'A DEFINITIONS ::= BEGIN B ::= INTEGER >!<(| SIZE (1))END': Expected END.
asn1tools> E       ?                                        ^^                                            +                 ++++++++++++
asn1tools> 
asn1tools> tests/test_parse.py:367: AssertionError
asn1tools> _________ Asn1ToolsParseTest.test_parse_error_missing_union_member_end _________
asn1tools> 
asn1tools> self = <tests.test_parse.Asn1ToolsParseTest testMethod=test_parse_error_missing_union_member_end>
asn1tools> 
asn1tools>     def test_parse_error_missing_union_member_end(self):
asn1tools>         with self.assertRaises(asn1tools.ParseError) as cm:
asn1tools>             asn1tools.parse_string('A DEFINITIONS ::= BEGIN '
asn1tools>                                    'B ::= INTEGER (SIZE (1) |)'
asn1tools>                                    'END')
asn1tools>     
asn1tools> >       self.assertEqual(
asn1tools>             str(cm.exception),
asn1tools>             "Invalid ASN.1 syntax at line 1, column 39: \'A DEFINITIONS "
asn1tools>             "::= BEGIN B ::= INTEGER >!<(SIZE (1) |)END\': Expected END.")
asn1tools> E       AssertionError: "Inva[30 chars]lumn 49: 'A DEFINITIONS ::= BEGIN B ::= INTEGE[20 chars]': ." != "Inva[30 chars]lumn 39: 'A DEFINITIONS ::= BEGIN B ::= INTEGE[32 chars]END."
asn1tools> E       - Invalid ASN.1 syntax at line 1, column 49: 'A DEFINITIONS ::= BEGIN B ::= INTEGER (SIZE (1) >!<|)END': .
asn1tools> E       ?                                        ^                                                    ---
asn1tools> E       + Invalid ASN.1 syntax at line 1, column 39: 'A DEFINITIONS ::= BEGIN B ::= INTEGER >!<(SIZE (1) |)END': Expected END.
asn1tools> E       ?                                        ^                                          +++                  ++++++++++++
asn1tools> 
asn1tools> tests/test_parse.py:389: AssertionError
asn1tools> _______ Asn1ToolsParseTest.test_parse_error_missing_union_member_middle ________
asn1tools> 
asn1tools> self = <tests.test_parse.Asn1ToolsParseTest testMethod=test_parse_error_missing_union_member_middle>
asn1tools> 
asn1tools>     def test_parse_error_missing_union_member_middle(self):
asn1tools>         with self.assertRaises(asn1tools.ParseError) as cm:
asn1tools>             asn1tools.parse_string('A DEFINITIONS ::= BEGIN '
asn1tools>                                    'B ::= INTEGER (SIZE (1) | | (0))'
asn1tools>                                    'END')
asn1tools>     
asn1tools> >       self.assertEqual(
asn1tools>             str(cm.exception),
asn1tools>             "Invalid ASN.1 syntax at line 1, column 39: \'A DEFINITIONS "
asn1tools>             "::= BEGIN B ::= INTEGER >!<(SIZE (1) | | (0))END\': Expected END.")
asn1tools> E       AssertionError: "Inva[30 chars]lumn 49: 'A DEFINITIONS ::= BEGIN B ::= INTEGE[26 chars]': ." != "Inva[30 chars]lumn 39: 'A DEFINITIONS ::= BEGIN B ::= INTEGE[38 chars]END."
asn1tools> E       - Invalid ASN.1 syntax at line 1, column 49: 'A DEFINITIONS ::= BEGIN B ::= INTEGER (SIZE (1) >!<| | (0))END': .
asn1tools> E       ?                                        ^                                                    ---
asn1tools> E       + Invalid ASN.1 syntax at line 1, column 39: 'A DEFINITIONS ::= BEGIN B ::= INTEGER >!<(SIZE (1) | | (0))END': Expected END.
asn1tools> E       ?                                        ^                                          +++                        ++++++++++++
asn1tools> 
asn1tools> tests/test_parse.py:378: AssertionError
asn1tools> _______ Asn1ToolsParseTest.test_parse_error_sequence_missing_member_name _______
asn1tools> 
asn1tools> self = <tests.test_parse.Asn1ToolsParseTest testMethod=test_parse_error_sequence_missing_member_name>
asn1tools> 
asn1tools>     def test_parse_error_sequence_missing_member_name(self):
asn1tools>         with self.assertRaises(asn1tools.ParseError) as cm:
asn1tools>             asn1tools.parse_string('A DEFINITIONS ::= BEGIN'
asn1tools>                                    '  A ::= SEQUENCE { A } '
asn1tools>                                    'END')
asn1tools>     
asn1tools> >       self.assertEqual(
asn1tools>             str(cm.exception),
asn1tools>             "Invalid ASN.1 syntax at line 1, column 43: 'A DEFINITIONS ::= "
asn1tools>             "BEGIN  A ::= SEQUENCE { >!<A } END': Expected Type.")
asn1tools> E       AssertionError: "Inva[47 chars]ITIONS ::= BEGIN  A ::= SEQUENCE { >!<A } END': ." != "Inva[47 chars]ITIONS ::= BEGIN  A ::= SEQUENCE { >!<A } END': Expected Type."
asn1tools> E       - Invalid ASN.1 syntax at line 1, column 43: 'A DEFINITIONS ::= BEGIN  A ::= SEQUENCE { >!<A } END': .
asn1tools> E       + Invalid ASN.1 syntax at line 1, column 43: 'A DEFINITIONS ::= BEGIN  A ::= SEQUENCE { >!<A } END': Expected Type.
asn1tools> E       ?                                                                                                    +++++++++++++
asn1tools> 
asn1tools> tests/test_parse.py:344: AssertionError
asn1tools> __________ Asn1ToolsParseTest.test_parse_error_sequence_missing_type ___________
asn1tools> 
asn1tools> self = <tests.test_parse.Asn1ToolsParseTest testMethod=test_parse_error_sequence_missing_type>
asn1tools> 
asn1tools>     def test_parse_error_sequence_missing_type(self):
asn1tools>         with self.assertRaises(asn1tools.ParseError) as cm:
asn1tools>             asn1tools.parse_string('A DEFINITIONS ::= BEGIN'
asn1tools>                                    '  A ::= SEQUENCE { a } '
asn1tools>                                    'END')
asn1tools>     
asn1tools> >       self.assertEqual(
asn1tools>             str(cm.exception),
asn1tools>             "Invalid ASN.1 syntax at line 1, column 43: 'A DEFINITIONS ::= BEGIN "
asn1tools>             " A ::= SEQUENCE { >!<a } END': Expected Type.")
asn1tools> E       AssertionError: "Inva[31 chars]umn 45: 'A DEFINITIONS ::= BEGIN  A ::= SEQUEN[15 chars]': ." != "Inva[31 chars]umn 43: 'A DEFINITIONS ::= BEGIN  A ::= SEQUEN[28 chars]ype."
asn1tools> E       - Invalid ASN.1 syntax at line 1, column 45: 'A DEFINITIONS ::= BEGIN  A ::= SEQUENCE { a >!<} END': .
asn1tools> E       ?                                         ^                                            --
asn1tools> E       + Invalid ASN.1 syntax at line 1, column 43: 'A DEFINITIONS ::= BEGIN  A ::= SEQUENCE { >!<a } END': Expected Type.
asn1tools> E       ?                                         ^                                                ++        +++++++++++++
asn1tools> 
asn1tools> tests/test_parse.py:333: AssertionError
asn1tools> ___ Asn1ToolsParseTest.test_parse_error_size_constraint_missing_parentheses ____
asn1tools> 
asn1tools> self = <tests.test_parse.Asn1ToolsParseTest testMethod=test_parse_error_size_constraint_missing_parentheses>
asn1tools> 
asn1tools>     def test_parse_error_size_constraint_missing_parentheses(self):
asn1tools>         with self.assertRaises(asn1tools.ParseError) as cm:
asn1tools>             asn1tools.parse_string('A DEFINITIONS ::= BEGIN '
asn1tools>                                    'B ::= INTEGER (SIZE 1)'
asn1tools>                                    'END')
asn1tools>     
asn1tools> >       self.assertEqual(
asn1tools>             str(cm.exception),
asn1tools>             "Invalid ASN.1 syntax at line 1, column 45: \'A DEFINITIONS ::= "
asn1tools>             "BEGIN B ::= INTEGER (SIZE >!<1)END\': Expected '('.")
asn1tools> E       AssertionError: "Inva[46 chars]NITIONS ::= BEGIN B ::= INTEGER (SIZE >!<1)END': ." != "Inva[46 chars]NITIONS ::= BEGIN B ::= INTEGER (SIZE >!<1)END': Expected '('."
asn1tools> E       - Invalid ASN.1 syntax at line 1, column 45: 'A DEFINITIONS ::= BEGIN B ::= INTEGER (SIZE >!<1)END': .
asn1tools> E       + Invalid ASN.1 syntax at line 1, column 45: 'A DEFINITIONS ::= BEGIN B ::= INTEGER (SIZE >!<1)END': Expected '('.
asn1tools> E       ?                                                                                                    ++++++++++++
asn1tools> 
asn1tools> tests/test_parse.py:400: AssertionError
asn1tools> _______ Asn1ToolsParseTest.test_parse_error_size_constraint_missing_size _______
asn1tools> 
asn1tools> self = <tests.test_parse.Asn1ToolsParseTest testMethod=test_parse_error_size_constraint_missing_size>
asn1tools> 
asn1tools>     def test_parse_error_size_constraint_missing_size(self):
asn1tools>         with self.assertRaises(asn1tools.ParseError) as cm:
asn1tools>             asn1tools.parse_string('A DEFINITIONS ::= BEGIN '
asn1tools>                                    'B ::= INTEGER (SIZE ())'
asn1tools>                                    'END')
asn1tools>     
asn1tools> >       self.assertEqual(
asn1tools>             str(cm.exception),
asn1tools>             "Invalid ASN.1 syntax at line 1, column 46: 'A DEFINITIONS ::= "
asn1tools>             "BEGIN B ::= INTEGER (SIZE (>!<))END': Expected one or more "
asn1tools>             "constraints.")
asn1tools> E       AssertionError: "Inva[67 chars]:= INTEGER (SIZE (>!<))END': ." != "Inva[67 chars]:= INTEGER (SIZE (>!<))END': Expected one or more constraints."
asn1tools> E       - Invalid ASN.1 syntax at line 1, column 46: 'A DEFINITIONS ::= BEGIN B ::= INTEGER (SIZE (>!<))END': .
asn1tools> E       + Invalid ASN.1 syntax at line 1, column 46: 'A DEFINITIONS ::= BEGIN B ::= INTEGER (SIZE (>!<))END': Expected one or more constraints.
asn1tools> E       ?                                                                                                     ++++++++++++++++++++++++++++++++
asn1tools> 
asn1tools> tests/test_parse.py:411: AssertionError
asn1tools> _________ Asn1ToolsParseTest.test_parse_error_tag_class_number_missing _________
asn1tools> 
asn1tools> self = <tests.test_parse.Asn1ToolsParseTest testMethod=test_parse_error_tag_class_number_missing>
asn1tools> 
asn1tools>     def test_parse_error_tag_class_number_missing(self):
asn1tools>         with self.assertRaises(asn1tools.ParseError) as cm:
asn1tools>             asn1tools.parse_string('A DEFINITIONS ::= BEGIN '
asn1tools>                                    'B ::= [] INTEGER '
asn1tools>                                    'END')
asn1tools>     
asn1tools> >       self.assertEqual(
asn1tools>             str(cm.exception),
asn1tools>             "Invalid ASN.1 syntax at line 1, column 32: 'A DEFINITIONS "
asn1tools>             "::= BEGIN B ::= [>!<] INTEGER END': Expected ClassNumber.")
asn1tools> E       AssertionError: "Inva[49 chars]IONS ::= BEGIN B ::= [>!<] INTEGER END': ." != "Inva[49 chars]IONS ::= BEGIN B ::= [>!<] INTEGER END': Expected ClassNumber."
asn1tools> E       - Invalid ASN.1 syntax at line 1, column 32: 'A DEFINITIONS ::= BEGIN B ::= [>!<] INTEGER END': .
asn1tools> E       + Invalid ASN.1 syntax at line 1, column 32: 'A DEFINITIONS ::= BEGIN B ::= [>!<] INTEGER END': Expected ClassNumber.
asn1tools> E       ?                                                                                               ++++++++++++++++++++
asn1tools> 
asn1tools> tests/test_parse.py:423: AssertionError
asn1tools> ________ Asn1ToolsParseTest.test_parse_error_too_many_extension_markers ________
asn1tools> 
asn1tools> self = <tests.test_parse.Asn1ToolsParseTest testMethod=test_parse_error_too_many_extension_markers>
asn1tools> 
asn1tools>     def test_parse_error_too_many_extension_markers(self):
asn1tools>         with self.assertRaises(asn1tools.ParseError) as cm:
asn1tools>             asn1tools.parse_string('A DEFINITIONS ::= BEGIN '
asn1tools>                                    'Foo ::= SEQUENCE { '
asn1tools>                                    'a BOOLEAN, '
asn1tools>                                    '..., '
asn1tools>                                    '[[ '
asn1tools>                                    'b BOOLEAN '
asn1tools>                                    ']], '
asn1tools>                                    '[[ '
asn1tools>                                    'c BOOLEAN '
asn1tools>                                    ']], '
asn1tools>                                    '..., '
asn1tools>                                    'd BOOLEAN, '
asn1tools>                                    '... '
asn1tools>                                    '} '
asn1tools>                                    'END')
asn1tools>     
asn1tools> >       self.assertEqual(
asn1tools>             str(cm.exception),
asn1tools>             "Invalid ASN.1 syntax at line 1, column 108: \'A DEFINITIONS ::= "
asn1tools>             "BEGIN Foo ::= SEQUENCE { a BOOLEAN, ..., [[ b BOOLEAN ]], [[ c "
asn1tools>             "BOOLEAN ]], ..., d BOOLEAN>!<, ... } END\': Expected Type.")
asn1tools> E       AssertionError: "Inva[117 chars][[ c BOOLEAN ]], ..., d BOOLEAN>!<, ... } END': ." != "Inva[117 chars][[ c BOOLEAN ]], ..., d BOOLEAN>!<, ... } END': Expected Type."
asn1tools> E       - Invalid ASN.1 syntax at line 1, column 108: 'A DEFINITIONS ::= BEGIN Foo ::= SEQUENCE { a BOOLEAN, ..., [[ b BOOLEAN ]], [[ c BOOLEAN ]], ..., d BOOLEAN>!<, ... } END': .
asn1tools> E       + Invalid ASN.1 syntax at line 1, column 108: 'A DEFINITIONS ::= BEGIN Foo ::= SEQUENCE { a BOOLEAN, ..., [[ b BOOLEAN ]], [[ c BOOLEAN ]], ..., d BOOLEAN>!<, ... } END': Expected Type.
asn1tools> E       ?                                                                                                                                                                          +++++++++++++
asn1tools> 
asn1tools> tests/test_parse.py:486: AssertionError
asn1tools> ____ Asn1ToolsParseTest.test_parse_error_type_assignment_missing_assignment ____
asn1tools> 
asn1tools> self = <tests.test_parse.Asn1ToolsParseTest testMethod=test_parse_error_type_assignment_missing_assignment>
asn1tools> 
asn1tools>     def test_parse_error_type_assignment_missing_assignment(self):
asn1tools>         with self.assertRaises(asn1tools.ParseError) as cm:
asn1tools>             asn1tools.parse_string('A DEFINITIONS ::= BEGIN A END')
asn1tools>     
asn1tools> >       self.assertEqual(str(cm.exception),
asn1tools>                          "Invalid ASN.1 syntax at line 1, column 27: "
asn1tools>                          "'A DEFINITIONS ::= BEGIN A >!<END': "
asn1tools>                          "Expected ::=.")
asn1tools> E       AssertionError: "Inva[26 chars], column 27: 'A DEFINITIONS ::= BEGIN A >!<END': ." != "Inva[26 chars], column 27: 'A DEFINITIONS ::= BEGIN A >!<END': Expected ::=."
asn1tools> E       - Invalid ASN.1 syntax at line 1, column 27: 'A DEFINITIONS ::= BEGIN A >!<END': .
asn1tools> E       + Invalid ASN.1 syntax at line 1, column 27: 'A DEFINITIONS ::= BEGIN A >!<END': Expected ::=.
asn1tools> E       ?                                                                                ++++++++++++
asn1tools> 
asn1tools> tests/test_parse.py:313: AssertionError
asn1tools> ___ Asn1ToolsParseTest.test_parse_error_value_assignment_missing_assignment ____
asn1tools> 
asn1tools> self = <tests.test_parse.Asn1ToolsParseTest testMethod=test_parse_error_value_assignment_missing_assignment>
asn1tools> 
asn1tools>     def test_parse_error_value_assignment_missing_assignment(self):
asn1tools>         with self.assertRaises(asn1tools.ParseError) as cm:
asn1tools>             asn1tools.parse_string('A DEFINITIONS ::= BEGIN a INTEGER END')
asn1tools>     
asn1tools> >       self.assertEqual(str(cm.exception),
asn1tools>                          "Invalid ASN.1 syntax at line 1, column 35: "
asn1tools>                          "'A DEFINITIONS ::= BEGIN a INTEGER >!<END': "
asn1tools>                          "Expected ::=.")
asn1tools> E       AssertionError: "Inva[34 chars] 35: 'A DEFINITIONS ::= BEGIN a INTEGER >!<END': ." != "Inva[34 chars] 35: 'A DEFINITIONS ::= BEGIN a INTEGER >!<END': Expected ::=."
asn1tools> E       - Invalid ASN.1 syntax at line 1, column 35: 'A DEFINITIONS ::= BEGIN a INTEGER >!<END': .
asn1tools> E       + Invalid ASN.1 syntax at line 1, column 35: 'A DEFINITIONS ::= BEGIN a INTEGER >!<END': Expected ::=.
asn1tools> E       ?                                                                                        ++++++++++++
asn1tools> 
asn1tools> tests/test_parse.py:322: AssertionError
asn1tools> =========================== short test summary info ============================
```


Discussion / hints:
I'm sorry, but I don't have time to look into this.
Hello there!
Fellow asn1-admirers, no need to worry - this is a known issue in a recent @pyparsing. See issue pyparsing/pyparsing#527 for further details. 

A fix is on the way ( pyparsing/pyparsing#534 ) and let's hope it lands shortly!
Well, unfortunately 3.1.2 introduced more regressions :)
[builder-live.log](https://github.com/eerimoq/asn1tools/files/15310438/builder-live.log)


Fix patch:
diff --git a/requirements.txt b/requirements.txt
index e65917b..98a93a0 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,4 +1,4 @@
-pyparsing>=3.0.6,<3.1
+pyparsing>=3.1.2
 codespell
 pyasn1
 asn1crypto
diff --git a/setup.py b/setup.py
index ddb42a9..a79e2ee 100755
--- a/setup.py
+++ b/setup.py
@@ -27,7 +27,7 @@ def find_version():
       url='https://github.com/eerimoq/asn1tools',
       packages=find_packages(exclude=['tests']),
       install_requires=[
-          'pyparsing>=3.0.6',
+          'pyparsing>=3.1.2',
           'bitstruct'
       ],
       extras_require={


Test patch:
diff --git a/tests/test_parse.py b/tests/test_parse.py
index f5ac129..cfadf83 100644
--- a/tests/test_parse.py
+++ b/tests/test_parse.py
@@ -332,8 +332,8 @@ def test_parse_error_sequence_missing_type(self):
 
         self.assertEqual(
             str(cm.exception),
-            "Invalid ASN.1 syntax at line 1, column 43: 'A DEFINITIONS ::= BEGIN "
-            " A ::= SEQUENCE { >!<a } END': Expected Type.")
+            "Invalid ASN.1 syntax at line 1, column 45: 'A DEFINITIONS ::= BEGIN "
+            " A ::= SEQUENCE { a >!<} END': Expected Type.")
 
     def test_parse_error_sequence_missing_member_name(self):
         with self.assertRaises(asn1tools.ParseError) as cm:
@@ -344,7 +344,7 @@ def test_parse_error_sequence_missing_member_name(self):
         self.assertEqual(
             str(cm.exception),
             "Invalid ASN.1 syntax at line 1, column 43: 'A DEFINITIONS ::= "
-            "BEGIN  A ::= SEQUENCE { >!<A } END': Expected Type.")
+            "BEGIN  A ::= SEQUENCE { >!<A } END': Expected '}'.")
 
     def test_parse_error_definitive_identifier(self):
         with self.assertRaises(asn1tools.ParseError) as cm:
@@ -366,8 +366,8 @@ def test_parse_error_missing_union_member_beginning(self):
 
         self.assertEqual(
             str(cm.exception),
-            "Invalid ASN.1 syntax at line 1, column 39: 'A DEFINITIONS ::= BEGIN "
-            "B ::= INTEGER >!<(| SIZE (1))END': Expected END.")
+            "Invalid ASN.1 syntax at line 1, column 40: 'A DEFINITIONS ::= BEGIN "
+            "B ::= INTEGER (>!<| SIZE (1))END': Expected one or more constraints.")
 
     def test_parse_error_missing_union_member_middle(self):
         with self.assertRaises(asn1tools.ParseError) as cm:
@@ -377,8 +377,8 @@ def test_parse_error_missing_union_member_middle(self):
 
         self.assertEqual(
             str(cm.exception),
-            "Invalid ASN.1 syntax at line 1, column 39: \'A DEFINITIONS "
-            "::= BEGIN B ::= INTEGER >!<(SIZE (1) | | (0))END\': Expected END.")
+            "Invalid ASN.1 syntax at line 1, column 49: \'A DEFINITIONS "
+            "::= BEGIN B ::= INTEGER (SIZE (1) >!<| | (0))END\': Expected ')'.")
 
     def test_parse_error_missing_union_member_end(self):
         with self.assertRaises(asn1tools.ParseError) as cm:
@@ -388,8 +388,8 @@ def test_parse_error_missing_union_member_end(self):
 
         self.assertEqual(
             str(cm.exception),
-            "Invalid ASN.1 syntax at line 1, column 39: \'A DEFINITIONS "
-            "::= BEGIN B ::= INTEGER >!<(SIZE (1) |)END\': Expected END.")
+            "Invalid ASN.1 syntax at line 1, column 49: \'A DEFINITIONS "
+            "::= BEGIN B ::= INTEGER (SIZE (1) >!<|)END\': Expected ')'.")
 
     def test_parse_error_size_constraint_missing_parentheses(self):
         with self.assertRaises(asn1tools.ParseError) as cm:
@@ -463,7 +463,7 @@ def test_parse_error_late_extension_additions(self):
             str(cm.exception),
             "Invalid ASN.1 syntax at line 1, column 63: \'A DEFINITIONS ::= "
             "BEGIN Foo ::= SEQUENCE { a BOOLEAN, ..., ...>!<, [[ c BOOLEAN ]] "
-            "} END\': Expected Type.")
+            "} END\': Expected '}'.")
 
     def test_parse_error_too_many_extension_markers(self):
         with self.assertRaises(asn1tools.ParseError) as cm:
@@ -487,7 +487,7 @@ def test_parse_error_too_many_extension_markers(self):
             str(cm.exception),
             "Invalid ASN.1 syntax at line 1, column 108: \'A DEFINITIONS ::= "
             "BEGIN Foo ::= SEQUENCE { a BOOLEAN, ..., [[ b BOOLEAN ]], [[ c "
-            "BOOLEAN ]], ..., d BOOLEAN>!<, ... } END\': Expected Type.")
+            "BOOLEAN ]], ..., d BOOLEAN>!<, ... } END\': Expected '}'.")
 
     def test_parse_error_missing_single_line_comment_end(self):
         with self.assertRaises(asn1tools.ParseError) as cm: