Make SingleValueConstraint accept alternatives
[third_party/asn1ate.git] / asn1ate / parser.py
index 7b0012ff673b2cf542d36393e307341f39448b8a..4fd341e42945040bbfb767bc2744c813171bc8d0 100644 (file)
@@ -239,7 +239,8 @@ def _build_asn1_grammar():
     # todo: consider the full subtype and general constraint syntax described in 45.*
     lower_bound = (constraint_real_value | signed_number | referenced_value | MIN)
     upper_bound = (constraint_real_value | signed_number | referenced_value | MAX)
-    single_value_constraint = Suppress('(') + value + Suppress(')')
+
+    single_value_constraint = Suppress('(') + Group(delimitedList(value, delim='|')) + Suppress(')')
     value_range_constraint = Suppress('(') + lower_bound + Suppress('..') + upper_bound + Suppress(')')
     # TODO: Include contained subtype constraint here if we ever implement it.
     size_constraint = Optional(Suppress('(')) + Suppress(SIZE) + (single_value_constraint | value_range_constraint) + Optional(Suppress(')'))