Fixed multiplicity infinity in class diagrams parser
This commit is contained in:
parent
596abf5cdd
commit
cfafbc2efa
1 changed files with 4 additions and 1 deletions
|
|
@ -86,7 +86,10 @@ def parse_cd(state, m_text):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def INT_OR_INF(self, el):
|
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):
|
def multiplicity(self, el):
|
||||||
[lower, upper] = el
|
[lower, upper] = el
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue