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

Fix up typescript member expression assignment - revert qualified identifier business

This commit is contained in:
Timothy Clem 2018-03-27 10:20:10 -07:00
parent 42b6f7d347
commit 4e6fb7a6f1

View File

@ -265,12 +265,7 @@ ternaryExpression :: Assignment
ternaryExpression = makeTerm <$> symbol Grammar.TernaryExpression <*> children (Statement.If <$> term expression <*> term expression <*> term expression) ternaryExpression = makeTerm <$> symbol Grammar.TernaryExpression <*> children (Statement.If <$> term expression <*> term expression <*> term expression)
memberExpression :: Assignment memberExpression :: Assignment
memberExpression = (symbol Grammar.MemberExpression <|> symbol Grammar.MemberExpression') *> children (qualifiedIdentifier <|> memberAccess) memberExpression = makeTerm <$> (symbol Grammar.MemberExpression <|> symbol Grammar.MemberExpression') <*> children (Expression.MemberAccess <$> term expression <*> term propertyIdentifier)
where
memberAccess = makeTerm <$> location <*> (Expression.MemberAccess <$> term expression <*> term propertyIdentifier)
qualifiedIdentifier = makeTerm <$> location <*> ((\a b -> Syntax.Identifier (qualifiedName [a, b])) <$> identifier' <*> propertyIdentifier')
identifier' = (symbol Identifier <|> symbol Identifier') *> source
propertyIdentifier' = symbol PropertyIdentifier *> source
newExpression :: Assignment newExpression :: Assignment
newExpression = makeTerm <$> symbol Grammar.NewExpression <*> children (Expression.New . pure <$> term expression) newExpression = makeTerm <$> symbol Grammar.NewExpression <*> children (Expression.New . pure <$> term expression)