1
1
mirror of https://github.com/github/semantic.git synced 2024-12-21 05:41:54 +03:00

Assign booleanOperator

This commit is contained in:
Rick Winfrey 2017-05-17 16:15:56 -07:00
parent fe9c8fb9d2
commit 7002862245

View File

@ -19,6 +19,7 @@ type Syntax' =
'[ Comment.Comment
, Declaration.Import
, Expression.Arithmetic
, Expression.Boolean
, Expression.Bitwise
, Expression.Tuple
, Expression.Unary
@ -78,6 +79,12 @@ binaryOperator = makeTerm <$> symbol BinaryOperator <*> children ( expression >>
<|> symbol AnonLAngleLAngle *> (Expression.LShift lexpression <$> expression)
<|> symbol AnonRAngleRAngle *> (Expression.RShift lexpression <$> expression)
booleanOperator :: HasCallStack => Assignment (Node Grammar) (Term Syntax Location)
booleanOperator = makeTerm <$> symbol BooleanOperator <*> children ( expression >>= \ lexpression -> (booleanOperator' lexpression))
where
booleanOperator' lexpression = symbol AnonAnd *> (Expression.And lexpression <$> expression)
<|> symbol AnonOr *> (Expression.Or lexpression <$> expression)
identifier :: HasCallStack => Assignment (Node Grammar) (Term Syntax Location)
identifier = makeTerm <$> symbol Identifier <*> (Syntax.Identifier <$> source)