1
1
mirror of https://github.com/github/semantic.git synced 2025-01-04 13:34:31 +03:00

Merge branch 'master' into bump-haskell-tree-sitter

This commit is contained in:
Rick Winfrey 2018-05-23 13:10:41 -07:00 committed by GitHub
commit bd3001a359
20 changed files with 73 additions and 61 deletions

View File

@ -29,6 +29,7 @@ data Comparison a
| GreaterThan !a !a
| GreaterThanEqual !a !a
| Equal !a !a
| StrictEqual !a !a
| Comparison !a !a
deriving (Diffable, Eq, Foldable, Functor, GAlign, Generic1, Hashable1, Mergeable, Ord, Show, Traversable, FreeVariables1, Declarations1)
@ -45,7 +46,10 @@ instance Evaluatable Comparison where
(LessThanEqual a b) -> liftComparison (Concrete (<=)) a b
(GreaterThan a b) -> liftComparison (Concrete (>)) a b
(GreaterThanEqual a b) -> liftComparison (Concrete (>=)) a b
-- TODO: in PHP and JavaScript, the equals operator performs type coercion.
-- We need some mechanism to customize this behavior per-language.
(Equal a b) -> liftComparison (Concrete (==)) a b
(StrictEqual a b) -> liftComparison (Concrete (==)) a b
(Comparison a b) -> liftComparison Generalized a b
-- | Binary arithmetic operators.

View File

@ -243,8 +243,10 @@ binaryExpression = makeTerm' <$> symbol BinaryExpression <*> children (infixTerm
, (inject .) . Expression.BXOr <$ symbol AnonCaret
, (inject .) . Expression.BAnd <$ symbol AnonAmpersand
, (inject .) . Expression.Or <$ symbol AnonQuestionQuestion -- Not sure if this is right.
, (inject .) . Expression.Equal <$ (symbol AnonEqualEqual <|> symbol AnonEqualEqualEqual)
, (inject .) . Expression.Equal <$ symbol AnonEqualEqual
, (inject .) . Expression.StrictEqual <$ symbol AnonEqualEqualEqual
, (inject .) . invert Expression.Equal <$ (symbol AnonBangEqual <|> symbol AnonLAngleRAngle <|> symbol AnonBangEqualEqual)
, (inject .) . invert Expression.StrictEqual <$ symbol AnonBangEqualEqual
, (inject .) . Expression.LessThan <$ symbol AnonLAngle
, (inject .) . Expression.GreaterThan <$ symbol AnonRAngle
, (inject .) . Expression.LessThanEqual <$ symbol AnonLAngleEqual

View File

@ -455,6 +455,10 @@ binary = makeTerm' <$> symbol Binary <*> children (infixTerm expression expressi
, (inject .) . Ruby.Syntax.LowOr <$ symbol AnonOr
, (inject .) . Expression.BOr <$ symbol AnonPipe
, (inject .) . Expression.BXOr <$ symbol AnonCaret
-- TODO: AnonEqualEqualEqual corresponds to Ruby's "case equality"
-- function, which (unless overridden) is true if b is an instance
-- of or inherits from a. We need a custom equality operator
-- for this situation.
, (inject .) . Expression.Equal <$ (symbol AnonEqualEqual <|> symbol AnonEqualEqualEqual)
, (inject .) . invert Expression.Equal <$ symbol AnonBangEqual
, (inject .) . Expression.LShift <$ symbol AnonLAngleLAngle

View File

@ -844,8 +844,10 @@ binaryExpression = makeTerm' <$> symbol BinaryExpression <*> children (infixTerm
, (inject .) . Expression.BOr <$ symbol AnonPipe
, (inject .) . Expression.BXOr <$ symbol AnonCaret
, (inject .) . Expression.InstanceOf <$ symbol AnonInstanceof
, (inject .) . Expression.Equal <$ (symbol AnonEqualEqual <|> symbol AnonEqualEqualEqual)
, (inject .) . invert Expression.Equal <$ (symbol AnonBangEqual <|> symbol AnonBangEqualEqual)
, (inject .) . Expression.Equal <$ symbol AnonEqualEqual
, (inject .) . Expression.StrictEqual <$ symbol AnonEqualEqualEqual
, (inject .) . invert Expression.Equal <$ symbol AnonBangEqual
, (inject .) . invert Expression.StrictEqual <$ symbol AnonBangEqualEqual
, (inject .) . Expression.LShift <$ symbol AnonLAngleLAngle
, (inject .) . Expression.RShift <$ symbol AnonRAngleRAngle
, (inject .) . Expression.UnsignedRShift <$ symbol AnonRAngleRAngleRAngle

View File

@ -10,7 +10,7 @@
(Identifier))
(
(If
(Equal
(StrictEqual
(Identifier)
(Float))
(

View File

@ -10,7 +10,7 @@
(Identifier))
(
(If
(Equal
(StrictEqual
(Identifier)
(Float))
(

View File

@ -10,7 +10,7 @@
(Identifier))
(
(If
(Equal
(StrictEqual
(Identifier)
(Float))
(

View File

@ -10,7 +10,7 @@
(Identifier))
(
(If
(Equal
(StrictEqual
(Identifier)
(Float))
(

View File

@ -10,7 +10,7 @@
(Identifier))
(
(If
(Equal
(StrictEqual
(Identifier)
(Float))
(

View File

@ -10,7 +10,7 @@
(Identifier))
(
(If
(Equal
(StrictEqual
(Identifier)
(Float))
(

View File

@ -10,7 +10,7 @@
(Identifier))
(
(If
(Equal
(StrictEqual
(Identifier)
(Float))
(

View File

@ -10,7 +10,7 @@
(Identifier))
(
(If
(Equal
(StrictEqual
(Identifier)
(Float))
(

View File

@ -10,7 +10,7 @@
(Identifier))
(
(If
(Equal
(StrictEqual
(Identifier)
(Float))
(

View File

@ -10,7 +10,7 @@
(Identifier))
(
(If
(Equal
(StrictEqual
(Identifier)
(Float))
(

View File

@ -10,7 +10,7 @@
(Identifier))
(
(If
(Equal
(StrictEqual
(Identifier)
(Float))
(

View File

@ -10,7 +10,7 @@
(Identifier))
(
(If
(Equal
(StrictEqual
(Identifier)
(Float))
(

View File

@ -10,7 +10,7 @@
(Identifier))
(
(If
(Equal
(StrictEqual
(Identifier)
(Float))
(

View File

@ -10,7 +10,7 @@
(Identifier))
(
(If
(Equal
(StrictEqual
(Identifier)
(Float))
(

View File

@ -10,7 +10,7 @@
(Identifier))
(
(If
(Equal
(StrictEqual
(Identifier)
(Float))
(

View File

@ -10,7 +10,7 @@
(Identifier))
(
(If
(Equal
(StrictEqual
(Identifier)
(Float))
(