Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 6b457fd3 authored by Marc Coiffier's avatar Marc Coiffier
Browse files

Implement a new kind of "quiet" mustache in CaPriCon, to allow precise...

Implement a new kind of "quiet" mustache in CaPriCon, to allow precise formatting commands to be inserted into a document
parent 3b7c5fde
......@@ -2,7 +2,7 @@
-- see http://haskell.org/cabal/users-guide/
name: capricon
version: 0.13
version: 0.13.1
-- synopsis:
-- description:
license: GPL-3
......
......@@ -154,7 +154,7 @@ runWordsState ws st = ($st) $ from (stateT.concatT) $^ do
runWithFS :: JS.JSString -> FSIO a -> JS.CIO a
runWithFS fsname (FSIO r) = newFS fsname >>= r^..readerT
hasteDict = cocDict ("0.13-js" :: String) getString getBytes setString setBytes
hasteDict = cocDict ("0.13.1-js" :: String) getString getBytes setString setBytes
main :: IO ()
main = do
......
......@@ -152,13 +152,23 @@ literate = liftA2 (\pref r -> pref + [Left (TextComment $ fromString r)])
where go = do pre; many' (noneOf ['\n']) <&> \x -> (fromString x,map fromString (stringWords x+["eol."]))
go_ex = do pre_ex; many' (noneOf ['\n']) <&> fromString
commentline :: Parser String [StackComment str :+: str]
commentline = map (foldMap (pure . (Left . TextComment) <|>
\(x,t) -> Left (BeginCodeSpan x):map Right t+[Left (EndCodeSpan x)])) $ (<* lookingAt eol)
$ many' (map (Left . fromString) (many1' (noneOf ['{','\n'] <+?
(fill '{' $ single '{' <* lookingAt (noneOf ['{']))))
<+? map Right (between "{{" "}}"
(many1' (noneOf ['}'] <+? fill '}' (single '}' <* lookingAt (noneOf ['}'])))
<&> \x -> (fromString x,stringWords (fromString x)+["mustache."]))))
commentline = map (foldMap ((pure . (Left . TextComment) <|>
\(x,t) -> Left (BeginCodeSpan x):map Right t+[Left (EndCodeSpan x)])
<|> map Right))
$ (<* lookingAt eol)
$ many' (map (Left . Left . fromString)
(many1' (noneOf ['{','\n']
<+? fill '{' (single '{' <* lookingAt (noneOf ['{','.']))))
<+?
map (Left . Right)
(between "{{" "}}"
(many1' (noneOf ['}'] <+? fill '}' (single '}' <* lookingAt (noneOf ['}'])))
<&> \x -> (fromString x,stringWords (fromString x)+["mustache."])))
<+?
map Right
(between "{." ".}"
(many1' (noneOf ['.'] <+? fill '.' (single '.' <* lookingAt (noneOf ['}']))))
<&> \x -> map fromString (stringWords x)))
data COCState str = COCState {
_endState :: Bool,
......
Markdown is supported
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