1
1
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:
Rob Rix 2019-09-27 18:43:29 -04:00
parent 3d93a5d947
commit 0b7f87dc11
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -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