1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 13:02:37 +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 term = isAnnotatable (category . extract $ term) $ term
where isAnnotatable = \case
C.Program -> Unannotatable
C.Params -> Unannotatable
C.ExpressionStatements -> Unannotatable
C.Args -> Unannotatable
C.Other _ -> Unannotatable
_ -> Annotatable
C.Class -> Annotatable
C.Method -> Annotatable
C.Function -> Annotatable
_ -> Unannotatable
data Identifiable a = Identifiable a | Unidentifiable a