mirror of
https://github.com/github/semantic.git
synced 2024-11-29 02:44:36 +03:00
Use withParser to define parseToAST.
This commit is contained in:
parent
b563f20edb
commit
c399f0d637
@ -60,7 +60,7 @@ parseToAST :: ( Bounded grammar
|
||||
-> Ptr TS.Language
|
||||
-> Blob
|
||||
-> m (Maybe (AST [] grammar))
|
||||
parseToAST parseTimeout language b@Blob{..} = bracket (liftIO TS.ts_parser_new) (liftIO . TS.ts_parser_delete) $ \ parser -> do
|
||||
parseToAST parseTimeout language b@Blob{..} = withParser language $ \ parser -> do
|
||||
compatible <- liftIO $ do
|
||||
let timeoutMicros = fromIntegral $ toMicroseconds parseTimeout
|
||||
TS.ts_parser_set_timeout_micros parser timeoutMicros
|
||||
|
Loading…
Reference in New Issue
Block a user