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

Use $! instead of seq.

This commit is contained in:
Rob Rix 2016-09-08 09:39:19 -04:00
parent e4a37940c0
commit 8ff6b1aa96

View File

@ -49,7 +49,7 @@ documentToTerm language document blob = alloca $ \ root -> do
, spanEnd = SourcePos (fromIntegral $! ts_node_p_end_point_row node) (fromIntegral $! ts_node_p_end_point_column node) }
-- Note: The strict application here is semantically important. Without it, we may not evaluate the range until after weve exited the scope that `node` was allocated within, meaning `alloca` will free it & other stack data may overwrite it.
range `seq` termConstructor (source blob) (sourceSpan `seq` pure sourceSpan) (toS name) range (filter (\child -> category (extract child) /= Empty) children)
range `seq` termConstructor (source blob) (pure $! sourceSpan) (toS name) range (filter (\child -> category (extract child) /= Empty) children)
getChild node n out = ts_node_p_named_child node n out >> toTerm out
{-# INLINE getChild #-}
termConstructor = case language of