From ee6c1f76675302461f70ecd9503c13a619b2adb6 Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Tue, 1 Aug 2017 11:40:43 -0700 Subject: [PATCH] Fallback to always catch binary minus for now --- src/Language/Ruby/Syntax.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Language/Ruby/Syntax.hs b/src/Language/Ruby/Syntax.hs index 661451676..cf8836a8a 100644 --- a/src/Language/Ruby/Syntax.hs +++ b/src/Language/Ruby/Syntax.hs @@ -367,13 +367,15 @@ binary = symbol Binary >>= \ loc -> children $ expression >>= \ lexpression -> g <|> mk AnonAmpersand Expression.BAnd <|> mk AnonCaret Expression.BXOr <|> mk AnonPipe Expression.BOr - -- TODO: binary minus (hidden node). Doesn't work b/c we can't match hidden nodes (they aren't in the tree). - -- <|> mk HiddenBinaryMinus Expression.Minus <|> mk AnonPlus Expression.Plus - -- TODO: binary star (hidden node) <|> mk AnonSlash Expression.DividedBy <|> mk AnonPercent Expression.Modulo <|> mk AnonStarStar Expression.Power + -- TODO: binary minus and binary star (hidden nodes). Doesn't work b/c we + -- can't match hidden nodes (they aren't in the tree). + -- <|> mk HiddenBinaryMinus Expression.Minus + -- FIXME: This falls through to always assign binary as minus, which isn't correct. + <|> makeTerm loc <$> (Expression.Minus lexpression <$> expression) where mk s constr = makeTerm loc <$> (symbol s *> (constr lexpression <$> expression)) mkNot s constr = makeTerm loc <$ symbol s <*> (Expression.Not <$> (makeTerm <$> location <*> (constr lexpression <$> expression)))