1
1
mirror of https://github.com/github/semantic.git synced 2024-11-29 02:44:36 +03:00

Curry defaultTermAssignment.

This commit is contained in:
Rob Rix 2017-01-20 13:07:19 -05:00
parent a6c897163c
commit 44ecf732fa

View File

@ -76,8 +76,8 @@ assignTerm = \case
Ruby -> Ruby.termAssignment
_ -> Language.termAssignment
defaultTermAssignment :: Source Char -> (Category, [ SyntaxTerm Text '[Range, Category, SourceSpan] ]) -> S.Syntax Text (SyntaxTerm Text '[Range, Category, SourceSpan])
defaultTermAssignment source = \case
defaultTermAssignment :: Source Char -> Category -> [ SyntaxTerm Text '[Range, Category, SourceSpan] ] -> S.Syntax Text (SyntaxTerm Text '[Range, Category, SourceSpan])
defaultTermAssignment source = curry $ \case
(Comment, _) -> S.Comment (toText source)
(_, []) -> S.Leaf (toText source)
(_, children) -> S.Indexed children