1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 07:25:44 +03:00

Match against anonymous symbols for TypeScript accessibility modifiers

This commit is contained in:
Rick Winfrey 2019-01-24 16:58:37 -08:00
parent 1e187d2f57
commit 21518197b4

View File

@ -482,16 +482,10 @@ parameter = requiredParameter
<|> optionalParameter <|> optionalParameter
accessibilityModifier' :: Assignment Term accessibilityModifier' :: Assignment Term
accessibilityModifier' = makeTerm' accessibilityModifier' = makeTerm <$> symbol AccessibilityModifier <*> children (public <|> protected <|> private)
<$> symbol AccessibilityModifier where public = symbol AnonPublic *> pure Declaration.Public
<*> children (inject <$> (textToAccessControl <$> source)) protected = symbol AnonProtected *> pure Declaration.Protected
private = symbol AnonPrivate *> pure Declaration.Private
textToAccessControl :: Text -> Declaration.AccessControl a
textToAccessControl = \case
"protected" -> Declaration.Protected
"private" -> Declaration.Private
-- | The catchall case is public.
_ -> Declaration.Public
destructuringPattern :: Assignment Term destructuringPattern :: Assignment Term
destructuringPattern = object <|> array destructuringPattern = object <|> array