Permalink
Browse files
Fix bug in previous commit: left_spid missing from DoubleQuotedPart.
Also: Re-enable translation errors in wild_report.py.
Parse errors and translation errors seem to match 0.6.pre2 now. TODO:
do another run.
- Loading branch information...
Showing
with
20 additions
and
15 deletions.
-
+6
−1
osh/word_parse.py
-
+12
−13
test/wild_report.py
-
+2
−1
tools/osh2oil.py
|
|
@@ -638,11 +638,15 @@ def _ReadDoubleQuotedPart(self, eof_type=Id.Undefined_Tok, here_doc=False): |
|
|
Also ${foo%%a b c} # treat this as double quoted. until you hit
|
|
|
"""
|
|
|
quoted_part = ast.DoubleQuotedPart()
|
|
|
left_spid = const.NO_INTEGER
|
|
|
|
|
|
left_spid = const.NO_INTEGER # gets set later
|
|
|
right_spid = const.NO_INTEGER # gets set later
|
|
|
|
|
|
if self.cur_token is not None: # None in here doc case
|
|
|
left_token = self.cur_token
|
|
|
left_spid = left_token.span_id
|
|
|
else:
|
|
|
left_token = None
|
|
|
|
|
|
done = False
|
|
|
while not done:
|
|
|
@@ -684,6 +688,7 @@ def _ReadDoubleQuotedPart(self, eof_type=Id.Undefined_Tok, here_doc=False): |
|
|
if here_doc: # here docs will have an EOF in their token stream
|
|
|
done = True
|
|
|
else:
|
|
|
assert left_token is not None # See hacky condition above
|
|
|
p_die('Unexpected EOF reading double-quoted string that began here',
|
|
|
token=left_token)
|
|
|
|
|
|
|
|
|
@@ -233,11 +233,9 @@ def MakeHtmlGroup(title_str, body_str): |
|
|
|
|
|
<td>
|
|
|
{.osh2oil_failed?}
|
|
|
<!-- <a class="fail" href="#stderr_osh2oil_{name}">FAIL</a> -->
|
|
|
FAIL
|
|
|
<a class="fail" href="#stderr_osh2oil_{name}">FAIL</a>
|
|
|
{.or}
|
|
|
<!-- <a class="ok" href="{name}__oil.txt">OK</a> -->
|
|
|
OK
|
|
|
<a class="ok" href="{name}__oil.txt">OK</a>
|
|
|
{.end}
|
|
|
</td>
|
|
|
<td class="name">
|
|
|
@@ -384,15 +382,16 @@ def UpdateNodes(node, path_parts, file_stats): |
|
|
})
|
|
|
osh2oil_stderr = file_stats.pop('osh2oil_stderr')
|
|
|
|
|
|
# Concentrating on parsing failures for now.
|
|
|
|
|
|
#if osh2oil_stderr or file_stats['osh2oil_failed']:
|
|
|
# node.stderr.append({
|
|
|
# 'parsing': False,
|
|
|
# 'action': 'osh2oil',
|
|
|
# 'name': first,
|
|
|
# 'contents': osh2oil_stderr,
|
|
|
# })
|
|
|
# TODO: Could disable this with a flag to concentrate on parse errors.
|
|
|
# Or just show parse errors all in one file.
|
|
|
if 1:
|
|
|
if osh2oil_stderr or file_stats['osh2oil_failed']:
|
|
|
node.stderr.append({
|
|
|
'parsing': False,
|
|
|
'action': 'osh2oil',
|
|
|
'name': first,
|
|
|
'contents': osh2oil_stderr,
|
|
|
})
|
|
|
|
|
|
# Attach to this dir
|
|
|
node.files[first] = file_stats
|
|
|
|
|
|
@@ -928,8 +928,9 @@ def DoWordInCommand(self, node, local_symbols): |
|
|
node.parts[0].tag == word_part_e.DoubleQuotedPart):
|
|
|
dq_part = node.parts[0]
|
|
|
|
|
|
# TODO: Double quoted part needs left and right IDs
|
|
|
left_spid, right_spid = dq_part.spids
|
|
|
# This is not set in the case of here docs? Why not?
|
|
|
#assert left_spid != const.NO_INTEGER, left_spid
|
|
|
assert right_spid != const.NO_INTEGER, right_spid
|
|
|
|
|
|
if len(dq_part.parts) == 1:
|
|
|
|
0 comments on commit
2bba597