mirror of
https://github.com/github/semantic.git
synced 2024-12-22 14:21:31 +03:00
Add AccessibilityModifier to Syntax
This commit is contained in:
parent
2084f1704b
commit
b3badde393
@ -62,6 +62,13 @@ newtype Program a = Program [a]
|
||||
instance Eq1 Program where liftEq = genericLiftEq
|
||||
instance Show1 Program where liftShowsPrec = genericLiftShowsPrec
|
||||
|
||||
-- | An accessibility modifier, e.g. private, public, protected, etc.
|
||||
newtype AccessibilityModifier a = AccessibilityModifier ByteString
|
||||
deriving (Diffable, Eq, Foldable, Functor, GAlign, Generic1, Show, Traversable)
|
||||
|
||||
instance Eq1 AccessibilityModifier where liftEq = genericLiftEq
|
||||
instance Show1 AccessibilityModifier where liftShowsPrec = genericLiftShowsPrec
|
||||
|
||||
|
||||
-- | Empty syntax, with essentially no-op semantics.
|
||||
--
|
||||
|
@ -67,6 +67,7 @@ type Syntax = '[
|
||||
, Statement.Try
|
||||
, Statement.While
|
||||
, Statement.Yield
|
||||
, Syntax.AccessibilityModifier
|
||||
, Syntax.Empty
|
||||
, Syntax.Error
|
||||
, Syntax.Identifier
|
||||
@ -154,6 +155,9 @@ parameter =
|
||||
<|> optionalParameter
|
||||
<|> parseError
|
||||
|
||||
accessibilityModifier :: Assignment
|
||||
accessibilityModifier = makeTerm <$> symbol AccessibilityModifier <*> (Syntax.AccessibilityModifier <$> source)
|
||||
|
||||
requiredParameter :: Assignment
|
||||
requiredParameter = makeTerm <$> symbol RequiredParameter <*> children ((,,,) <$> optional accessibilityModifier <*> (identifier <|> destructuringPattern) <*> optional typeAnnotation <*> optional initializer)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user