1
1
mirror of https://github.com/github/semantic.git synced 2025-01-05 14:11:33 +03:00

Limit syntaxes that are annotatable to subset of those syntaxes that are identifiable

This commit is contained in:
Rick Winfrey 2016-10-03 14:24:03 -05:00
parent bc02700086
commit 150127f99b

View File

@ -28,12 +28,10 @@ data Annotatable a = Annotatable a | Unannotatable a
annotatable :: (HasField fields Category) => SyntaxTerm leaf fields -> Annotatable (SyntaxTerm leaf fields) annotatable :: (HasField fields Category) => SyntaxTerm leaf fields -> Annotatable (SyntaxTerm leaf fields)
annotatable term = isAnnotatable (category . extract $ term) $ term annotatable term = isAnnotatable (category . extract $ term) $ term
where isAnnotatable = \case where isAnnotatable = \case
C.Program -> Unannotatable C.Class -> Annotatable
C.Params -> Unannotatable C.Method -> Annotatable
C.ExpressionStatements -> Unannotatable C.Function -> Annotatable
C.Args -> Unannotatable _ -> Unannotatable
C.Other _ -> Unannotatable
_ -> Annotatable
data Identifiable a = Identifiable a | Unidentifiable a data Identifiable a = Identifiable a | Unidentifiable a