mirror of
https://github.com/github/semantic.git
synced 2024-12-01 09:15:01 +03:00
WIP updates
This commit is contained in:
parent
d4ac4427d3
commit
76bba89d3c
@ -58,7 +58,7 @@ data DiffInfo = LeafInfo { categoryName :: Text, termName :: Text }
|
||||
| ErrorInfo { errorSpan :: SourceSpan, termName :: Text }
|
||||
deriving (Eq, Show)
|
||||
|
||||
data Branch = BIndexed | BFixed | BCommented deriving (Show, Eq, Generic)
|
||||
data Branch = BIndexed | BFixed | BCommented | BIf deriving (Show, Eq, Generic)
|
||||
|
||||
data DiffSummary a = DiffSummary {
|
||||
patch :: Patch a,
|
||||
@ -173,7 +173,9 @@ toTermName source term = case unwrap term of
|
||||
S.Pair a _ -> toTermName' a <> ": …"
|
||||
S.Return expr -> maybe "empty" toTermName' expr
|
||||
S.Error _ _ -> termNameFromSource term
|
||||
S.If expr _ _ -> termNameFromSource expr
|
||||
-- S.If expr _ _ -> termNameFromSource expr
|
||||
S.If expr _ Nothing -> termNameFromSource expr
|
||||
S.If expr _ (Just expr') -> termNameFromSource expr
|
||||
S.For clauses _ -> termNameFromChildren term clauses
|
||||
S.While expr _ -> toTermName' expr
|
||||
S.DoWhile _ expr -> toTermName' expr
|
||||
@ -221,6 +223,7 @@ termToDiffInfo blob term = case unwrap term of
|
||||
S.AnonymousFunction _ _ -> LeafInfo "anonymous function" (toTermName' term)
|
||||
Commented cs leaf -> BranchInfo (termToDiffInfo' <$> cs <> maybeToList leaf) (toCategoryName term) BCommented
|
||||
S.Error sourceSpan _ -> ErrorInfo sourceSpan (toTermName' term)
|
||||
-- S.If expr _ (Just expr') -> BranchInfo [(termToDiffInfo' expr), (termToDiffInfo' expr')] (toCategoryName term) BIf
|
||||
_ -> LeafInfo (toCategoryName term) (toTermName' term)
|
||||
where toTermName' = toTermName blob
|
||||
termToDiffInfo' = termToDiffInfo blob
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 7e9421a0f261a2de196d05d153a86dc4c8340351
|
||||
Subproject commit dce5b472e5bcc43861e65b412644c7931f12d313
|
Loading…
Reference in New Issue
Block a user