mirror of
https://github.com/github/semantic.git
synced 2024-11-24 17:04:47 +03:00
cleanup
This commit is contained in:
parent
b20ca6c997
commit
7b774d764c
@ -167,12 +167,9 @@ symbol s = tracing (Choose (Table.singleton s location) Nothing Nothing) `Then`
|
||||
rawSource :: HasCallStack => Assignment ast grammar ByteString
|
||||
rawSource = tracing Source `Then` return
|
||||
|
||||
-- | A rule to produce a node's source as Text. Fails if the node's source
|
||||
-- can't be parsed as UTF-8.
|
||||
-- | A rule to produce a node's source as Text. Fails if the node's source can't be parsed as UTF-8.
|
||||
source :: HasCallStack => Assignment ast grammar Text
|
||||
source = rawSource >>= \b -> case decodeUtf8' b of
|
||||
Right t -> pure t
|
||||
Left e -> fail ("UTF-8 decoding failed: " <> show e)
|
||||
source = fmap decodeUtf8' rawSource >>= either (\e -> fail ("UTF-8 decoding failed: " <> show e)) pure
|
||||
|
||||
-- | Match a node by applying an assignment to its children.
|
||||
children :: HasCallStack => Assignment ast grammar a -> Assignment ast grammar a
|
||||
|
Loading…
Reference in New Issue
Block a user