Skip to content

Commit

Permalink
[osh2oil] Don't crash on translation of EmptyPart.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Chu committed Aug 25, 2018
1 parent 25ef33c commit d9790db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/word.py
Expand Up @@ -157,6 +157,9 @@ def LeftMostSpanForPart(part):
elif part.tag == word_part_e.BracedAltPart:
return const.NO_INTEGER

elif part.tag == word_part_e.EmptyPart:
return const.NO_INTEGER

else:
raise AssertionError(part.__class__.__name__)

Expand Down
3 changes: 3 additions & 0 deletions tools/osh2oil.py
Expand Up @@ -1176,6 +1176,9 @@ def DoWordPart(self, node, local_symbols, quoted=False):
self.f.write(')')
self.cursor.SkipUntil(right_spid + 1)

elif node.tag == word_part_e.EmptyPart:
pass

else:
raise AssertionError(node.__class__.__name__)

Expand Down

0 comments on commit d9790db

Please sign in to comment.