1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 01:47:01 +03:00

Add ts_language_js as a language

This commit is contained in:
joshvera 2015-12-03 15:21:28 -05:00
parent c20ea6ee78
commit 79f2f94c2c
2 changed files with 6 additions and 2 deletions

View File

@ -28,6 +28,7 @@ import Foreign.ForeignPtr.Unsafe
data TSLanguage = TsLanguage deriving (Show, Eq)
foreign import ccall "prototype/doubt-difftool/doubt-difftool-Bridging-Header.h ts_language_c" ts_language_c :: IO (Ptr TSLanguage)
foreign import ccall "prototype/doubt-difftool/doubt-difftool-Bridging-Header.h ts_language_js" ts_language_js :: IO (Ptr TSLanguage)
data TSDocument = TsDocument deriving (Show, Eq)
foreign import ccall "prototype/External/tree-sitter/include/tree_sitter/runtime.h ts_document_make" ts_document_make :: IO (Ptr TSDocument)
@ -94,7 +95,7 @@ data ParserType = ParserC | ParserJS
parserForType mediaType = sequence $ case mediaType of
"h" -> Just ts_language_c
"c" -> Just ts_language_c
"js" -> Just ts_language_c
"js" -> Just ts_language_js
_ -> Nothing
parseTreeSitterFile :: Ptr TSLanguage -> String -> IO (Term String Info)

View File

@ -48,7 +48,10 @@ executable semantic-diff-exe
, filepath
default-language: Haskell2010
extra-libraries: bridge
extra-lib-dirs: prototype/External/tree-sitter/out/Release, prototype/External/tree-sitter-c, .
extra-lib-dirs: prototype/External/tree-sitter/out/Release
, prototype/External/tree-sitter-c
, prototype/External/tree-sitter-javascript
, .
test-suite semantic-diff-test
type: exitcode-stdio-1.0