Commit 187633e3 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Fix Ada backend bug

SEQUENCE OF literal issue reported by IB Krates
parent 01b8ece7
......@@ -2208,17 +2208,14 @@ def _sequence_of(seqof):
seqof_ty = seqof.exprType
try:
asn_type = find_basic_type(TYPES[seqof_ty.ReferencedTypeName].type)
min_size, max_size = asn_type.Min, asn_type.Max
except AttributeError:
asn_type = None
min_size, max_size = seqof_ty.Min, seqof_ty.Max
if hasattr(seqof, 'expected_type'):
asn_type = find_basic_type(
TYPES[seqof.expected_type.ReferencedTypeName].type.type)
try:
min_size, max_size = asn_type.Min, asn_type.Max
except AttributeError:
pass
sortref = TYPES[seqof.expected_type.ReferencedTypeName]
while(hasattr(sortref, "type")):
sortref = sortref.type
asn_type = find_basic_type(sortref)
tab = []
for i in xrange(len(seqof.value)):
item_stmts, item_str, local_var = expression(seqof.value[i])
......
......@@ -1548,7 +1548,8 @@ class SDL_View(QtGui.QGraphicsView, object):
''' Create the SDL view holding the scene '''
super(SDL_View, self).__init__(scene)
self.wrapping_window = None
self.messages_window = None
# self.messages_window = None
self.messages_window = QtGui.QListWidget() # default
self.mode = ''
self.phantom_rect = None
self.filename = ''
......
#!/usr/bin/env python
import pytest
from opengeode.opengeode import SDL_Scene
from PySide import QtCore
from opengeode.opengeode import SDL_Scene, SDL_View
from opengeode.sdlSymbols import Label, Decision
def test_1(qtbot):
''' Test the parsing of numbers '''
scene = SDL_Scene(context="process")
qtbot.addWidget(scene)
scene.add_symbol(Label)
# test = parser_init(string='''provided true=false; priority 5;''')
# res = test.continuous_signal()
view = SDL_View (scene)
view.show()
qtbot.addWidget(view)
qtbot.keyClick(view,25)
# assert(not isinstance(res.tree, antlr3.tree.CommonErrorNode))
......
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