1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 21:16:12 +03:00

Assign pointer references

This commit is contained in:
Rick Winfrey 2017-10-24 11:53:35 -07:00
parent 10f728d278
commit 4fe2ad2609

View File

@ -271,10 +271,11 @@ parenthesizedExpression :: Assignment
parenthesizedExpression = symbol ParenthesizedExpression *> children expressions
unaryExpression :: Assignment
unaryExpression = symbol UnaryExpression >>= \ location -> (notExpression location) <|> (unaryMinus location) <|> unaryPlus
unaryExpression = symbol UnaryExpression >>= \ location -> (notExpression location) <|> (unaryMinus location) <|> unaryPlus <|> unaryAmpersand
where notExpression location = makeTerm location . Expression.Not <$> children (symbol AnonBang *> expression)
unaryMinus location = makeTerm location . Expression.Negate <$> children (symbol AnonMinus *> expression)
unaryPlus = children (symbol AnonPlus *> expression)
unaryAmpersand = children (makeTerm <$> symbol AnonAmpersand <*> (Statement.Reference <$> expression))
binaryExpression :: Assignment
binaryExpression = makeTerm' <$> symbol BinaryExpression <*> children (infixTerm expression expression