From d5793fc78d1a27aaff3ed6a5198478e273ce2db5 Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Thu, 8 Jun 2017 11:12:35 -0700 Subject: [PATCH] JavaScript as a distinct language, but uses TypeScript parser --- src/Language.hs | 5 +++-- src/Parser.hs | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Language.hs b/src/Language.hs index 3ac854757..f86897322 100644 --- a/src/Language.hs +++ b/src/Language.hs @@ -13,10 +13,11 @@ import Term data Language = C | Go + | JavaScript | Markdown - | Ruby - | TypeScript -- ^ Also JavaScript. | Python + | Ruby + | TypeScript deriving (Show, Eq, Read, Generic, ToJSON) -- | Returns a Language based on the file extension (including the "."). diff --git a/src/Parser.hs b/src/Parser.hs index 47edb2aab..367832161 100644 --- a/src/Parser.hs +++ b/src/Parser.hs @@ -53,6 +53,7 @@ parserForLanguage Nothing = LineByLineParser parserForLanguage (Just language) = case language of C -> TreeSitterParser C tree_sitter_c Go -> TreeSitterParser Go tree_sitter_go + JavaScript -> TreeSitterParser TypeScript tree_sitter_typescript Ruby -> TreeSitterParser Ruby tree_sitter_ruby TypeScript -> TreeSitterParser TypeScript tree_sitter_typescript _ -> LineByLineParser