1
1
mirror of https://github.com/github/semantic.git synced 2025-01-04 05:27:08 +03:00

📝 advance & token.

This commit is contained in:
Rob Rix 2017-08-16 14:08:10 -04:00
parent 8bb23f0642
commit f71eab9ced

View File

@ -165,9 +165,11 @@ source = withFrozenCallStack $ Source `Then` return
children :: HasCallStack => Assignment ast grammar a -> Assignment ast grammar a
children forEach = withFrozenCallStack $ Children forEach `Then` return
-- | Advance past the current node.
advance :: HasCallStack => Assignment ast grammar ()
advance = withFrozenCallStack $ Advance `Then` return
-- | Match and advance past a node with the given symbol.
token :: (Bounded grammar, Ix grammar, HasCallStack) => grammar -> Assignment ast grammar (Record Location)
token s = symbol s <* advance