[ck2cti] Fix over-zealous detection of section 'end' labels

This commit is contained in:
Ray Speth 2019-02-04 18:17:39 -05:00
parent 33e198f7e5
commit e3424d8ed4
2 changed files with 9 additions and 9 deletions

View file

@ -1564,7 +1564,7 @@ class Parser(object):
if tokens[0].upper().startswith('ELEM'):
inHeader = False
tokens = tokens[1:]
while line is not None and not contains(line, 'END'):
while line is not None and get_index(line, 'END') is None:
# Grudging support for implicit end of section
start = line.strip().upper().split()
if start and start[0] in ('SPEC', 'SPECIES'):
@ -1588,7 +1588,7 @@ class Parser(object):
# List of species identifiers
tokens = tokens[1:]
inHeader = False
while line is not None and not contains(line, 'END'):
while line is not None and get_index(line, 'END') is None:
# Grudging support for implicit end of section
start = line.strip().upper().split()
if start and start[0] in ('REAC', 'REACTIONS', 'TRAN',
@ -1638,7 +1638,7 @@ class Parser(object):
surf = self.surfaces[-1]
inHeader = False
while line is not None and not contains(line, 'END'):
while line is not None and get_index(line, 'END') is None:
# Grudging support for implicit end of section
start = line.strip().upper().split()
if start and start[0] in ('REAC', 'REACTIONS', 'THER',
@ -1678,7 +1678,7 @@ class Parser(object):
inHeader = False
entryLength = None
entry = []
while line is not None and not get_index(line, 'END') == 0:
while line is not None and get_index(line, 'END') != 0:
# Grudging support for implicit end of section
start = line.strip().upper().split()
if start and start[0] in ('REAC', 'REACTIONS', 'TRAN', 'TRANSPORT'):
@ -1735,11 +1735,11 @@ class Parser(object):
# List of thermodynamics (hopefully one per species!)
inHeader = False
line, comment = readline()
if line is not None and not contains(line, 'END'):
if line is not None and get_index(line, 'END') is None:
TintDefault = float(line.split()[1])
thermo = []
current = []
while line is not None and not contains(line, 'END'):
while line is not None and get_index(line, 'END') != 0:
# Grudging support for implicit end of section
start = line.strip().upper().split()
if start and start[0] in ('REAC', 'REACTIONS', 'TRAN', 'TRANSPORT'):
@ -1831,7 +1831,7 @@ class Parser(object):
reactions = self.surfaces[-1].reactions
else:
reactions = self.reactions
while line is not None and not contains(line, 'END'):
while line is not None and get_index(line, 'END') is None:
# Grudging support for implicit end of section
start = line.strip().upper().split()
if start and start[0] in ('TRAN', 'TRANSPORT'):
@ -1893,7 +1893,7 @@ class Parser(object):
inHeader = False
line, comment = readline()
transport_start_line = self.line_number
while line is not None and not contains(line, 'END'):
while line is not None and get_index(line, 'END') is None:
# Grudging support for implicit end of section
start = line.strip().upper().split()
if start and start[0] in ('REAC', 'REACTIONS'):

View file

@ -31,7 +31,7 @@ trans_butene C 1H 4 G 200.000 3500.000 1000.000 1
7.48514950E-02 1.33909467E-02-5.73285809E-06 1.22292535E-09-1.01815230E-13 2
-9.46834459E+03 1.84373180E+01 5.14987613E+00-1.36709788E-02 4.91800599E-05 3
-4.84743026E-08 1.66693956E-11-1.02466476E+04-4.64130376E+00 4
plus+ C 1H 4 G 200.000 3500.000 1000.000 1
plus+ nottheend C 1H 4 G 200.000 3500.000 1000.000 1
7.48514950E-02 1.33909467E-02-5.73285809E-06 1.22292535E-09-1.01815230E-13 2
-9.46834459E+03 1.84373180E+01 5.14987613E+00-1.36709788E-02 4.91800599E-05 3
-4.84743026E-08 1.66693956E-11-1.02466476E+04-4.64130376E+00 4