úÎĪcĮ.š      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™(c) Ogma Project, 2016MIT experimentalSafe"‡Mostly in order to deal with typographic spaces, main punctuation marks are tokenized during the parsing of an Ogmarkup document.The character ;The character ,The character ?The character !The character "The character " The character  or the sequence -- The character  or the sequence --- The character , The character . The character -  Two or more . or the character & The characters ' or  {An Atom is the atomic component of a Ogmarkup document. It can be either a punctuation mark or a word, that is a string.Note that, by construction,  and  are not valid 2 values here. Indeed, they are implicit with the e constructor. This design allows the parser to enforce that an opened quote needs to be closed.A wrapped stringA punctuation markA nested formatted text3No particular emphasis is required on this sequenceSurrounded by *.Surrounded by **.ãA character's line of dialogue. A reply may contain a descriptive part, which is not part of what the character actually says or thinks. We call the latter a "with say" reply untill someone gives use a better name for it.$A reply of the form: "Good morning."=A reply of the form: "Good morning," she says. "How are you?"gA Component is either a narrative text, a character's line of dialogue or a character's inner thought.‹We also embed an error Component in case we fail to parse a valid component. This way, we can resume parsing when we meet a new paragraph.A narrative descriptionA dialogue replyInner dialogue of the characteruIf none of the above matched, then output what follows as-is, the parsing will be resumed at the next paragraph,A Paragraph is just a sequence of Component.˙A Section within an ogmarkup document is a sequence of paragraphs. It can be part of the story or an aside section like a letter, a song, etc. We make the distinction between the two cases because we want to be able to apply different style depending on the situation. The story as it goes!1Something else. Maybe a letter, a flashback, etc.#aA ogmarkup document internal representation waiting to be used in order to generate an output.$  !"#$  !"#$# !"    !"#(c) Ogma Project, 2016MIT experimentalSafe*0An ogmarkup parser processes š tokens and carries a 1.1+Keep track of the currently opened formats.3"Already parsing text with emphasis4,Already parsing text with strong emphasis5Already parsing a quote6 Update the 1" to guard against nested emphasis.7 Update the 10 to be able to parse input with emphasis again.8 Update the 1) to guard against nested strong emphasis.9 Update the 17 to be able to parse input with strong emphasis again.: Update the 1' to guard against nested quoted inputs.; Update the 1: to be able to parse an input surrounded by quotes again.<QA initial ParserState instance to be used at the begining of a document parsing.=A wrapper around the › function of Parsec. It uses < as an initial state.>vTry its best to parse an ogmarkup document. When it encounters an error, it returns an Ast and the remaining input.See #.?See .@See !.ASee  .BSee .CSee .DSee .E¯Parse the rest of the current paragraph with no regards for the ogmarkup syntax. This Parser is used when the document is ill-formed, to find a new point of synchronization.FSee .GSee .HSee .II c c' constr wraps a reply surrounded by c and c' inside constr (either  or ).J{Parse the name of the character which speaks or thinks. According to the ogmarkup syntax, it is surrounded by parentheses.KK parses a .LSee .MSee .NSee .OSee .PSee .QSee .RSee _. This parser does not consume the following spaces, so the caller needs to take care of it.S Wrap a raw string surrounded by ` inside a .parse longword "" "`test *ei*`"Right (Ast.Word "test *ei*") Therefore, `O can be used to insert normally reserved symbol inside a generated document.TSee . Be aware that T9 does not parse the quotes because they are processed P.USee 0. This parser consumes the following blank (see Y) and skip the result.VSee 0. This parser consumes the following blank (see Y) and skip the result.WAn aside section (see !{) is a particular region surrounded by two lines of underscores (at least three). This parser consumes one such line.X{The end of a paragraph is the end of the document or two blank lines or an aside separator, that is a line of underscores.YdThis parser consumes all the white spaces until it finds either an aside surrounding marker (see !c), the end of the document or one blank line. The latter marks the end of the current paragraph.Zskip p parses p and skips the result.+0123456789:;<=>?@ABCDEFGHI+A character to mark the begining of a reply&A character to mark the end of a replyEither  or  according to the situationJKLMNOPQRSTUVWXYZ+0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ+123456789:;<0=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ'0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ(c) Ogma Project, 2016MIT experimentalSafe[mA Typography is a data type that tells the caller what space should be privileged before and after a text.] For a given n, returns a tuple with the spaces to use before and after the punctuation mark and its output value.^lWhich mark to use to open a dialogue. If the parameter is True, there were another dialogue just before._jWhich mark to use to close a dialogue. If the parameter is True, there is another dialogue just after.`ĘDeal with typographic spaces, especially when it comes to separating two texts. Because Space derives Ord, it is possible to use min and max to determine which one to use in case of a conflict.a@A normal space that can be turned into a newline for displaying.b:A non breakable space, it cannot be turned into a newline.cNo space at all.dLFrom a Typography, it gives the space to privilege before the input Text.eKFrom a Typography, it gives the space to privilege after the input Text.f;Normalize the input in order to add it to a generated Text.gŠA proposal for the French typography. It can be used with several generation approaches, as it remains very generic. Requires the output type to be an instance of œ.hĒA proposal for the English typography. It can be used with several generation approaches, as it remains very generic. Requires the output type to be an instance of œ.iApply the function to each  output value[\]^_`abcdefghi[\]^_`abcdefgh`abc[\]^_idefgh[\]^_`abcdefghi(c) Ogma Project, 2016MIT experimentalSafe<=?lAn instance of the l- typeclass can be given as a parameter to a ˇ. In order to prevent GHC to overabstract this typeclass, there can be only one instance of GenConf for one datatype. In other words, one datatype can only handle one return type c.ÃFor each template, we give a prefered layout and some hints about the default implementation (which is almost always the identity function, ignoring all the parameters but the generated output.Warning: l! is a multiparam typeclass (see MultiParamTypeClasses^ GHC extension). In order to make new instances, the following extensions need to be enabled: FlexibleInstances MultiParamTypeClasses7Otherwise, GHC will not accept your instance statement.m Returns a [ instance to be used by the .Default implementation: returns h.nDThis template is used once the output has been completely generated.Layout: block Default implementation: the identity functiono…This template is used on the ill-formed portion of the ogmarkup document which have been ignored during the best-effort compilation.Layout: inlineDefault implementation: the identity functionpLThis template is used on regular sections which focus on telling the story.Layout: blockDefault implementation: the identity functionqhThis template is used on aside sections which may comprised flashbacks, letters or songs, for instance.Layout: blockDefault implementation:9 the identity function (it ignores the class name)r5This template is used on paragraphs within a section.Layout: blockDefault implementation: the identity functionsHThis template is used on the narrative portion of an ogmarkup document.Layout: inlineDefault implementation: the identity functiontŠThis template is used on audible dialogue. The class name is mandatory even if the character name is optional for dialogues and thoughts in the ogmarkup grammar. The za function is used by the generator to get a default value when no character names are provided.Layout: inlineDefault implementation: the identity functionu1This template is used on unaudible dialogue. See tA to get more information on why the class name is not optional.Layout: inlineDefault implementation: the identity functionwļReturn a marker to insert between two consecutive dialogues. The default use case is to return the concatenation of the ending mark and the opening mark of a paragraph. a paragrapLayout: inlineDefault implementation: x1A template to apply emphasis to an piece of text.Default implementation: the identity functionyCA template to apply stong emphasis (often bold) to a piece of text.Layout: inlineDefault implementation: z^This function is called by a Generator to derive a class name for an optional character name.Default implementation:7 simply unwrap the Maybe value, if Nothing return .{Generate an output from a `.|A |0 is just synonym for a template of one argument.lmnopqrstuvwxyz{|lmnopqrstuvwxyz{||lmnopqrstuvwxyz{lmnopqrstuvwxyz{|(c) Ogma Project, 2016MIT experimentalNoneI}The }‡ Monad is eventually used to generate an output from a given 'Ast.Document. Internally, it keeps track of the previous processed ' in order to deal with atom separation.€Run a }S monad and get the generated output. The output type has to implement the class ž because the } monad uses the > constant as the initial state of the output and then uses Ÿ5 to expand the result as it processes the generation.=Retrieve a configuration parameter. Let the output untouched.‚*Apply a template to the result of a given }; before appending it to the previously generated output.ƒ,Forget about the past and consider the next ! as the first to be processed.„0Append a new sub-output to the generated output.… Process an x and deal with the space to use to separate it from the paramter of the previous call (that is the last processed ).†Call … if the parameter is not  . Otherwise, do nothing.‡Process a sequence of .ˆ Process a .‰Process a sequence of .Š Process a .‹ Process a .Œ Process a  and deal with sequence of .Process a sequence of .Ž Process a .Process a sequence of . Process a #', that is a complete Ogmarkup document.}~€The } to run.The configuration to use during the generation The outputThe function to apply to the l- variable to retreive the wanted parameter‚The | to applyThe } to runƒ„A sub-output to append…†‡ˆ‰Š‹)Was the last component a piece of dialog?-Will the next component be a piece of dialog? The current component to processŒŽ}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ(c) Ogma Project, 2016MIT experimentalNone–ũWith the best-effort compilation feature of ogmarkup, when the parser encounters an error, it can apply two different strategies with the remaining input to find a new synchronization point. It can search character by character or line by line.™ÉFrom a String, parse and generate an output according to a generation configuration. The inner definitions of the parser and the generator imply that the output type has to be an instance of the œ and ž classes.–—˜™ Best-effort compilation strategyThe input stringThe generator configuration. [\]^_`abcghlmnopqrstuvwxyz{|–—˜™.–—˜™lmnopqrstuvwxyz{|gh[\]^_ `abc–—˜™Ą      !"#$%&'()*+,-./01234567899:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abbcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡TXˆ‰SŠRJI‹FŒEŽ‘’“”•–—˜™š›œžœŸ œŸĄœŸĸœŸŖ¤"ogmarkup-2.2-AbDTeWk8woPgGIcDOmgkbText.Ogmarkup.Private.AstText.Ogmarkup.Private.Parser Text.Ogmarkup.Private.TypographyText.Ogmarkup.Private.ConfigText.Ogmarkup.Private.Generator Text.Ogmarkup GeneratorMark SemicolonColonQuestion Exclamation OpenQuote CloseQuoteDashLongDashCommaPointHyphenSuspensionPoints ApostropheAtomWord PunctuationFormatRawEmph StrongEmphQuoteReplySimpleWithSay ComponentTellerDialogueThought IllFormed ParagraphSectionStoryAsideFailingDocument $fShowMark$fEqMark $fShowAtom$fEqAtom $fShowFormat $fEqFormat $fEqReply $fShowReply $fEqComponent$fShowComponent $fEqSection $fShowSectionOgmarkupParser ParserState parseWithEmphparseWithStrongEmphparseWithinQuote enterEmph leaveEmphenterStrongEmphleaveStrongEmph enterQuote leaveQuoteinitParserStateparsedocumentsectionasidestory paragraph component illformedrestOfParagraphtellerdialoguethoughttalk characterNamereplyformatrawemph strongEmphquoteatomwordlongwordmark openQuote closeQuoteasideSeparatorendOfParagraphblankskip Typographydecide openDialogue closeDialogueSpaceNormalNbspNone beforeAtom afterAtom normalizeAtom frenchTypo englishTypo$fFunctorTypography $fEqSpace $fOrdSpaceGenConf typographydocumentTemplate errorTemplate storyTemplate asideTemplateparagraphTemplatetellerTemplatedialogueTemplatethoughtTemplate replyTemplatebetweenDialogue emphTemplatestrongEmphTemplateauthorNormalize printSpaceTemplategetState runGeneratoraskConfapplyreset maybeAtomatomsformats paragraphssections$fFunctorGenerator$fApplicativeGenerator$fMonadGenerator$fMonadStateGenerator$fMonadReaderGeneratorStrategyByLineByCharogmarkupghc-prim GHC.TypesChar$parsec-3.1.11-37j7M1YEHqtEooY7BpJdri"Text.ParserCombinators.Parsec.Prim runParserbase Data.StringIsStringGHC.BasememptyMonoidmappendNothing