1
1
mirror of https://github.com/github/semantic.git synced 2024-12-25 07:55:12 +03:00
This commit is contained in:
Rob Rix 2018-07-10 12:53:56 -04:00
parent 8487f81b34
commit 98cc30705d
4 changed files with 5 additions and 3 deletions

View File

@ -86,6 +86,7 @@ convergingModules :: ( AbstractValue address value effects
, Member (State (Cache term address (Cell address) value)) effects
, Member (Env address) effects
, Member (State (Heap address (Cell address) value)) effects
, Effects effects
)
=> SubtermAlgebra Module term (TermEvaluator term address value effects address)
-> SubtermAlgebra Module term (TermEvaluator term address value effects address)

View File

@ -58,7 +58,7 @@ runParser parser blobSource = unsafeUseAsCStringLen (sourceBytes blobSource) $
-- | Parse 'Source' with the given 'TS.Language' and return its AST.
-- Returns Nothing if the operation timed out.
parseToAST :: (Bounded grammar, Enum grammar, Member (Lift IO) effects, Member Trace effects) => Timeout -> Ptr TS.Language -> Blob -> Eff effects (Maybe (AST [] grammar))
parseToAST :: (Bounded grammar, Enum grammar, Member (Lift IO) effects, Member Trace effects, Effects effects) => Timeout -> Ptr TS.Language -> Blob -> Eff effects (Maybe (AST [] grammar))
parseToAST (Milliseconds s) language Blob{..} = bracket TS.ts_parser_new TS.ts_parser_delete $ \ parser -> do
let parserTimeout = s * 1000

View File

@ -195,7 +195,7 @@ data ParserCancelled = ParserTimedOut deriving (Show, Typeable)
instance Exception ParserCancelled
-- | Parse a 'Blob' in 'IO'.
runParser :: (Member (Exc SomeException) effs, Member (Lift IO) effs, Member (Reader Config) effs, Member Telemetry effs, Member Trace effs) => Blob -> Parser term -> Eff effs term
runParser :: (Member (Exc SomeException) effs, Member (Lift IO) effs, Member (Reader Config) effs, Member Telemetry effs, Member Trace effs, Effects effs) => Blob -> Parser term -> Eff effs term
runParser blob@Blob{..} parser = case parser of
ASTParser language ->
time "parse.tree_sitter_ast_parse" languageTag $ do
@ -225,6 +225,7 @@ runParser blob@Blob{..} parser = case parser of
, Member (Reader Config) effs
, Member Telemetry effs
, Member Trace effs
, Effects effs
)
=> (Source -> assignment (Term (Sum syntaxes) (Record Assignment.Location)) -> ast -> Either (Error.Error String) (Term (Sum syntaxes) (Record Assignment.Location)))
-> Parser ast

2
vendor/effects vendored

@ -1 +1 @@
Subproject commit f1f98bb60f7df34359f4a6e1487353a0c644311b
Subproject commit 9e21513e029812b6c9244e02628bffe31a9caed9