Permalink
Browse files

Handle parse failure on left-hand side of logical or (#124)

  • Loading branch information...
Yorwba authored and andychu committed May 28, 2018
1 parent 3315b78 commit 451ca9e2b437e0326fc8155783d970a6f32729d8
Showing with 2 additions and 0 deletions.
  1. +2 −0 osh/bool_parse.py
View
@@ -156,6 +156,8 @@ def ParseExpr(self):
Expr : Term (OR Expr)?
"""
left = self.ParseTerm()
if not left:
return None # TODO: An exception should handle this case.
# [[ uses || while [ uses -o
if self.op_id in (Id.Op_DPipe, Id.BoolUnary_o):
if not self._Next(): return None

0 comments on commit 451ca9e

Please sign in to comment.