Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add parser of data block to dynamically declare size of data block #22

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add parser of data block to dynamically declare size of data block in…
… v files.Example 'var(1:N-1) /5*0/' -> 'var(1:N-1) /(N-1)*0/
  • Loading branch information
jguterl committed Oct 3, 2020
commit 0c38f11a27738df3d20daa85bb4339fde03452b3
9 changes: 6 additions & 3 deletions source/interfaceparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def processfile(packname, filename, othermacros=[], timeroutines=0):

# Check to make sure that the package name is correct
if packname != line:
print """
print("""

Warning: the package name in the file does not agree
with the file name. Make sure that the first line of the
Expand All @@ -52,7 +52,7 @@ def processfile(packname, filename, othermacros=[], timeroutines=0):
your system. (This can be done in vi by opening the file and
typing ":set fileformat=unix" and then saving the file.)

"""%(packname, line)
"""%(packname, line))
return []

# Remove all line continuation marks
Expand Down Expand Up @@ -308,6 +308,9 @@ def processfile(packname, filename, othermacros=[], timeroutines=0):
elif text[i] == "'": i = re.search("'", text[2:]).start() + 2
i = re.search('/', text[i:]).start() + i
data = text[0:i+1]
if data.count('(')==1 and data.count(')')==1:
arg=str(eval(data.split('(')[1].split(')')[0]))
data=data.split('(')[0]+arg+data.split(')')[1]
# Handle the old Basis syntax for initial logical values.
if data[1:-1] == 'FALSE': data = '/.false./'
if data[1:-1] == 'TRUE': data = '/.true./'
Expand Down Expand Up @@ -520,7 +523,7 @@ def findmatchingparenthesis(i, text, errname):
elif text[i] == ')':
p = p - 1
except IndexError:
print 'Error in subscript of variable '+errname
print('Error in subscript of variable '+errname)
return i

def convertdimstringtodims(dimstring):
Expand Down