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:
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 :: (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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user