1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 13:02:37 +03:00

Merge pull request #860 from github/bump-tree-sitter-parsers

Set a default encoding to utf8 and bump tree sitter parsers
This commit is contained in:
Josh Vera 2016-10-05 12:58:37 -04:00 committed by GitHub
commit 39f3fcb2af
2 changed files with 6 additions and 2 deletions

View File

@ -29,6 +29,7 @@ import Syntax
import System.Directory
import System.FilePath
import qualified System.IO as IO
import System.Environment (lookupEnv)
import Term
import TreeSitter
import Text.Parser.TreeSitter.Language
@ -158,7 +159,10 @@ printDiff parser arguments sources = do
writeToOutput :: Maybe FilePath -> Text -> IO ()
writeToOutput output text =
case output of
Nothing -> TextIO.putStr text
Nothing -> do
lang <- lookupEnv "LANG"
if isNothing lang then IO.hSetEncoding IO.stdout IO.utf8 else pure ()
TextIO.hPutStrLn IO.stdout text
Just path -> do
isDir <- doesDirectoryExist path
let outputPath = if isDir

@ -1 +1 @@
Subproject commit 65dbeffe72d53d4547f63077bdf4ca6b986129df
Subproject commit 8348194cc52b4b9fd61e3988b9526b54ebfef920