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:
parent
c20ea6ee78
commit
79f2f94c2c
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user