mirror of
https://github.com/github/semantic.git
synced 2024-11-24 00:42:33 +03:00
Define a custom ToTagsBy instance for Java.Program.
This is primarily to avoid having to set -freduction-depth=0 in Language.Java.
This commit is contained in:
parent
3d93a5d947
commit
0b7f87dc11
@ -45,6 +45,7 @@ data Strategy = Generic | Custom
|
||||
|
||||
type family ToTagsInstance t :: Strategy where
|
||||
ToTagsInstance (_ :+: _) = 'Custom
|
||||
ToTagsInstance Java.Program = 'Custom
|
||||
ToTagsInstance Java.MethodDeclaration = 'Custom
|
||||
ToTagsInstance _ = 'Generic
|
||||
|
||||
@ -53,6 +54,9 @@ instance (ToTags l, ToTags r) => ToTagsBy 'Custom (l :+: r) where
|
||||
tags' (L1 l) = tags l
|
||||
tags' (R1 r) = tags r
|
||||
|
||||
instance ToTagsBy 'Custom Java.Program where
|
||||
tags' Java.Program { extraChildren } = traverse_ tags extraChildren
|
||||
|
||||
instance ToTagsBy 'Custom Java.MethodDeclaration where
|
||||
tags' Java.MethodDeclaration
|
||||
{ ann = Loc range span
|
||||
|
Loading…
Reference in New Issue
Block a user