Commit f9860557 authored by Marc Coiffier's avatar Marc Coiffier
Browse files

Correct a small parser bug that caused some interactive commands to need two...

Correct a small parser bug that caused some interactive commands to need two newlines instead of one
parent 7cb70066
......@@ -164,7 +164,7 @@ interactiveSession ack = while sessionLine
s <- remaining
cmd <- hspace >> many1' (satisfy (\c -> not (isSpace c || c=='\'')))
let onCurlyCmd = runStreamState (put s) >> codeLine
maybe onCurlyCmd snd (foldMap snd commands^.at cmd) <* hspace <* (eol+eoi)
maybe onCurlyCmd (\(_,x) -> x <* hspace <* (eol+eoi)) (foldMap snd commands^.at cmd)
codeLine = withMountain $ do
(ws,ln) <- listen $ muteOnSuccess $ option' Nothing (Just <$> withSessionLib curlyLine)
......@@ -173,8 +173,7 @@ interactiveSession ack = while sessionLine
Nothing -> guard (empty ws) >> parseCmd
parseCmd = hspace >> do
(n,e) <- withParsedString (optimized =<< accessorExpr HorizSpaces)
lookingAt (hspace >> eol)
(n,e) <- withParsedString (optimized =<< accessorExpr HorizSpaces) <* hspace <* eol
withPatterns $ withStyle $ showExprDefault (docTag' "call" [Pure "show-default"]) n e
return False
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment