Fixed multiplicity infinity in class diagrams parser

This commit is contained in:
Joeri Exelmans 2024-10-16 09:22:45 +02:00
parent 596abf5cdd
commit cfafbc2efa

View file

@ -86,7 +86,10 @@ def parse_cd(state, m_text):
return True
def INT_OR_INF(self, el):
return float('inf') if el == "*" else int(el)
# infinity only used for upper cardinality,
# where the default value (None) represents infinity
# cannot use `float('inf')` because then it violates the constraint of type 'Integer'
return None if el == "*" else int(el)
def multiplicity(self, el):
[lower, upper] = el