1
1
mirror of https://github.com/github/semantic.git synced 2024-12-19 21:01:35 +03:00

Labels replace expectations.

This commit is contained in:
Rob Rix 2017-08-06 12:57:28 -04:00
parent fb6298ba6d
commit 76edea1341

View File

@ -251,7 +251,7 @@ runAssignment toNode source = (\ assignment state -> go assignment state >>= req
Project{} -> Left (makeError node, state) Project{} -> Left (makeError node, state)
Children{} -> Left (makeError node, state) Children{} -> Left (makeError node, state)
Source -> Left (makeError node, state) Source -> Left (makeError node, state)
Label child _ -> go child state >>= uncurry yield Label child label -> go child state `catchError` (throwError . first (\ err -> err { errorExpected = [Left label] })) >>= uncurry yield
state@State{..} = if not (null expectedSymbols) && all ((== Regular) . symbolType) expectedSymbols then dropAnonymous initialState else initialState state@State{..} = if not (null expectedSymbols) && all ((== Regular) . symbolType) expectedSymbols then dropAnonymous initialState else initialState
expectedSymbols = firstSet (assignment `Then` return) expectedSymbols = firstSet (assignment `Then` return)