10
0
mirror of https://gitlab.com/scemama/irpf90.git synced 2024-12-22 12:23:32 +01:00

Better error handling

Version:1.2.2
This commit is contained in:
Anthony Scemama 2011-09-12 10:02:14 +02:00
parent b43edb99c5
commit fc531fe0d2

View File

@ -186,7 +186,10 @@ class Variable(object):
if '_type' not in self.__dict__: if '_type' not in self.__dict__:
line = self.line.text line = self.line.text
buffer = line.split(',')[0] buffer = line.split(',')[0]
try:
buffer = buffer.split('[')[1].strip() buffer = buffer.split('[')[1].strip()
except IndexError:
error.fail(None,"Error in definition of %s."%(self.name))
if self.dim != []: if self.dim != []:
buffer = "%s, allocatable"%(buffer) buffer = "%s, allocatable"%(buffer)
self._type = buffer self._type = buffer