From d9790db49b8763c618695d6732bdb6789b75a57c Mon Sep 17 00:00:00 2001 From: Andy Chu Date: Sat, 25 Aug 2018 13:12:43 -0700 Subject: [PATCH] [osh2oil] Don't crash on translation of EmptyPart. --- core/word.py | 3 +++ tools/osh2oil.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/core/word.py b/core/word.py index bcc374204b..fa794a4206 100644 --- a/core/word.py +++ b/core/word.py @@ -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__) diff --git a/tools/osh2oil.py b/tools/osh2oil.py index 2c413cfaac..3690d97a18 100644 --- a/tools/osh2oil.py +++ b/tools/osh2oil.py @@ -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__)