Commit c1435610 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Fix case sensitivity in Ada backend

parent 490a0fc3
......@@ -1231,17 +1231,23 @@ def _expr_in(expr):
@expression.register(ogAST.PrimEnumeratedValue)
def _enumerated_value(primary):
''' Generate code for an enumerated value '''
enumerant = primary.value[0].replace('_', '-')
enumerant = primary.value[0].replace('_', '-').lower()
basic = find_basic_type(primary.exprType)
ada_string = (u'asn1Scc' + basic.EnumValues[enumerant].EnumID)
for each in basic.EnumValues:
if each.lower() == enumerant:
break
ada_string = (u'asn1Scc' + basic.EnumValues[each].EnumID)
return [], unicode(ada_string), []
@expression.register(ogAST.PrimChoiceDeterminant)
def _choice_determinant(primary):
''' Generate code for a choice determinant (enumerated) '''
enumerant = primary.value[0].replace('_', '-')
ada_string = primary.exprType.EnumValues[enumerant].EnumID
enumerant = primary.value[0].replace('_', '-').lower()
for each in primary.exprType.EnumValues:
if each.lower() == enumerant:
break
ada_string = primary.exprType.EnumValues[each].EnumID
return [], unicode(ada_string), []
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment