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:
parent
bc02700086
commit
150127f99b
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user