6%PL      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJK(c) Oren Ben-Kiki 2007LGPLyaml-oren@ben-kiki.orgalphaportableNone9:;<=?K. converts a (named) input text into a list of *. Errors are reported as tokens with the Error U, and the unparsed text following an error may be attached as a final token (if the Bool is True). Note that tokens are available "immediately", allowing for streaming of large YAML files with memory requirements depending only on the YAML nesting level. Chomp method.L Remove all trailing line breaks.MKeep first trailing line break.NKeep all trailing line breaks.Production context.OOutside block sequence.PInside block sequence.QOutside flow collection.RInside flow collection.SImplicit block key.TImplicit flow key.UMatch parameter result# specifies that we can convert the  parameter to a V returning the result.WThe internal parser state. We don't bother with parameterising it with a "UserState", we just bundle the generic and specific fields together (not that it is that easy to draw the line - is sLine generic or specific?).X"The input name for error messages.YThe input UTF encoding.ZCurrent decision name.[Lookahead characters limit.\Pattern we must not enter into.]Disables token generation.^Is at start of line?_,(Reversed) characters collected for a token.`)Byte offset of first collected character.a)Char offset of first collected character.b"Line of first collected character.c/Character in line of first collected character.dOffset in bytes in the input.e"Offset in characters in the input.f'Builds on YAML's line break definition.gCharacter number in line.h%Of token we are collecting chars for.iLast matched character.jThe decoded input characters.kEach invication of a V yields a k. The l is only one part of the k.mParsing result.nTokens generated by the parser.oCommitment to a decision point.pThe updated parser state.lThe ln of each invocation is either an error, the actual result, or a continuation for computing the actual result.qParsing aborted with a failure.r Parsing completed with a result.s'Parsing is ongoing with a continuation.VA V% is basically a function computing a k. Parsed token.t0-base byte offset in stream.u"0-base character offset in stream.v1-based line number.w0-based character in line.xSpecific token .yContained input chars, if any. codes.BOM, contains "TF8", "TF16LE", "TF32BE", etc.Content text characters.#Non-content (meta) text characters.Separation line break. +Line break normalized to content line feed. #Line break folded to content space. Character indicating structure. Separation white space. Indentation spaces.Document start marker.Document end marker.Begins escape sequence.Ends escape sequence.Begins comment. Ends comment.Begins directive.Ends directive. Begins tag. Ends tag.Begins tag handle.Ends tag handle.Begins anchor. Ends anchor.Begins node properties.Ends node properties. Begins alias. Ends alias. Begins scalar content.!Ends scalar content."Begins sequence content.#Ends sequence content.$Begins mapping content.%Ends mapping content.&Begins mapping key:value pair.'Ends mapping key:value pair.(Begins complete node.)Ends complete node.*Begins document.+Ends document.,Begins YAML stream.-Ends YAML stream..Parsing error at this point./+Unparsed due to errors (or at end of test).0!Detected parameter (for testing).zERecognized Unicode encodings. As of YAML 1.2 UTF-32 is also required.{UTF-8 encoding (or ASCII)|UTF-16 little endian}UTF-16 big endian~UTF-32 little endianUTF-32 big endianD".+" is the numeric addition (we use "+" for postfix "one or more").A".-" is the numeric subtraction (we use "-" for infix "and not").L".*" is the numeric multiplication (we use "*" for postfix "zero or more").".#" is the numeric division (we use "" for infix "or").record |> field is the same as  field record, but is more readable. decode bytes automatically detects the z used and converts the bytesp to Unicode characters, with byte offsets. Note the offset is for past end of the character, not its beginning.detectEncoding text- examines the first few chars (bytes) of the textA to deduce the Unicode encoding used according to the YAML spec.undoEncoding encoding bytes converts a bytes0 stream to Unicode characters according to the encoding.hasFewerThan bytes n% checks whether there are fewer than n bytes left to read.undoUTF32LE bytes offset decoded a UTF-32LE bytes stream to Unicode chars.undoUTF32BE bytes offset decoded a UTF-32BE bytes stream to Unicode chars.combinePairs charsR converts each pair of UTF-16 surrogate characters to a single Unicode character.combineLead lead rest combines the lead! surrogate with the head of the rest% of the input chars, assumed to be a trail5 surrogate, and continues combining surrogate pairs.surrogateOffset! is copied from the Unicode FAQs.combineSurrogates lead trailA combines two UTF-16 surrogates into a single Unicode character.undoUTF18LE bytes offset decoded a UTF-16LE bytes stream to Unicode chars.undoUTF18BE bytes offset decoded a UTF-16BE bytes stream to Unicode chars.undoUTF8 bytes offset decoded a UTF-8 bytes stream to Unicode chars. decodeTwoUTF8 first offset bytes0 decodes a two-byte UTF-8 character, where the first> byte is already available and the second is the head of the bytes0, and then continues to undo the UTF-8 encoding.combineTwoUTF8 first second combines the first and second< bytes of a two-byte UTF-8 char into a single Unicode char."decodeThreeUTF8 first offset bytes2 decodes a three-byte UTF-8 character, where the firstI byte is already available and the second and third are the head of the bytes0, and then continues to undo the UTF-8 encoding.combineThreeUTF8 first second combines the first, second and third> bytes of a three-byte UTF-8 char into a single Unicode char.!decodeFourUTF8 first offset bytes1 decodes a four-byte UTF-8 character, where the firstQ byte is already available and the second, third and fourth are the head of the bytes0, and then continues to undo the UTF-8 encoding.combineFourUTF8 first second combines the first, second and third> bytes of a three-byte UTF-8 char into a single Unicode char.escapeString string. escapes all the non-ASCII characters in the string, as well as escaping the "\" character, using the "\xXX", "\uXXXX" and " \UXXXXXXXX" escape sequences.toHex digits int converts the int) to the specified number of hexadecimal digits.1showTokens tokens converts a list of tokens to a multi-line YEAST text.initialState name input returns an initial W for parsing the input (with name for error messages).setDecision name state sets the  sDecision field to decision.setLimit limit state sets the sLimit field to limit.setForbidden forbidden state sets the  sForbidden field to  forbidden.setCode code state sets the sCode field to code.returnReply state result prepares a k with the specified state and result.tokenReply state token returns a k containing the state and tokenu. Any collected characters are cleared (either there are none, or we put them in this token, or we don't want them).failReply state message prepares a k with the specified state and error message.unexpectedReply state returns a  failReply for an unexpected character. parser % n repeats parser exactly n times. parser <% n matches fewer than n occurrences of parser."decision ^ (option / option / ...) provides a decision3 name to the choice about to be made, to allow to commit to it.parser ! decision commits to decision1 (in an option) after successfully matching the parser.parser ?! decision commits to decision1 (in an option) if the current position matches parser#, without consuming any characters. lookbehind <? matches the current point without consuming any characters, if the previous character matches the lookbehind parser (single character positive lookbehind) lookahead >?t matches the current point without consuming any characters if it matches the lookahead parser (positive lookahead) lookbehind <? matches the current point without consuming any characters, if the previous character does not match the lookbehind parser (single character negative lookbehind) lookahead >?t matches the current point without consuming any characters if it matches the lookahead parser (negative lookahead)parser - rejected matches parser , except if rejected matches at this point.before & after parses before and, if it succeeds, parses after&. This basically invokes the monad's >>= (bind) method.first / second tries to parse first, and failing that parses second , unless first2 has committed in which case is fails immediately. (optional ?) tries to match parser, otherwise does nothing. (parser *)% matches zero or more occurrences of repeat:, as long as each one actually consumes input characters. (parser +)$ matches one or more occurrences of parser:, as long as each one actually consumed input characters.decide first second tries to parse first, and failing that parses second , unless first2 has committed in which case is fails immediately.choice decision parser provides a decision) name to the choice about to be made in parser, to allow to commit to it.parser ` ` pattern parses the specified parser$; if it fails, it continues to the recovery parser to recover. prev parser succeeds if parserC matches at the previous character. It does not consume any input. peek parser succeeds if parser8 matches at this point, but does not consume any input.reject parser name fails if parser8 matches at this point, and does nothing otherwise. If nameb is provided, it is used in the error message, otherwise the messages uses the current character. upto parserj consumes all the character up to and not including the next point where the specified parser is a match.nonEmpty parser succeeds if parser8 matches some non-empty input characters at this point.empty, always matches without consuming any input.eof matches the end of the input.sol matches the start of a line.commit decisionG commits the parser to all the decisions up to the most recent parent decision\. This makes all tokens generated in this parsing path immediately available to the caller.nextLine increments sLine counter and resets  sLineChar.#with setField getField value parser invokes the specified parser/ with the value of the specified field set to value0 for the duration of the invocation, using the setField and getField functions to manipulate it.parser ` ` pattern parses the specified parser: ensuring that it does not contain anything matching the  forbidden parser.parser `` limit parses the specified parser2 ensuring that it does not consume more than the limit input chars. nextIf test+ fails if the current position matches the W forbidden pattern or if the Wf lookahead limit is reached. Otherwise it consumes (and buffers) the next input char if it satisfies test. finishTokenx places all collected text into a new token and begins a new one, or does nothing if there are no collected characters. wrap parser invokes the parser, ensures any unclaimed input characters are wrapped into a token (only happens when testing productions), ensures no input is left unparsed, and returns the parser's result.consume parser invokes the parser< and then consumes all remaining unparsed input characters.token code parser places all text matched by parser into a  with the specified codeL (unless it is empty). Note it collects the text even if there is an error.fake code text$ creates a token with the specified code and "fake" textA characters, instead of whatever characters are collected so far. meta parser, collects the text matched by the specified parser into a | Meta token.indicator code, collects the text matched by the specified parser into an  Indicator token. text parser- collects the text matched by the specified parser into a Text token.emptyToken code returns an empty token.#wrapTokens beginCode endCode parser wraps the specified parser with matching  beginCode and endCode tokens.prefixErrorWith pattern prefix will invoke the prefix, parser if an error is detected during the pattern# parser, and then return the error.patternTokenizer pattern converts the pattern to a simple .parserTokenizer what parser converts the parser returning what to a simple D (only used for tests). The result is reported as a token with the Detected - The result is reported as a token with the Detected ..errorTokens tokens state message withFollowing appends an Error token with the specified message at the end of tokens , and if  withFollowing@ also appends the unparsed text following the error as a final Unparsed token.commitBugs replym inserts an error token if a commit was made outside a named choice. This should never happen outside tests.2yaml name input converts the Unicode input (called name" in error messages) to a list of ( according to the YAML spec. This is it! pName name2 converts a parser name to the "proper" spec name. tokenizersE returns a mapping from a production name to a production tokenizer.3tokenizer name, converts the production with the specified name to a simple , or Nothing if it isn't known.tokenizersWithNT returns a mapping from a production name to a production tokenizer (that takes an n argument).4tokenizerWithN name n+ converts the production (that requires an n argument) with the specified name to a simple , or Nothing if it isn't known.tokenizersWithCS returns a mapping from a production name to a production tokenizer (that takes a c argument).5tokenizerWithC name c* converts the production (that requires a c argument) with the specified name to a simple , or Nothing if it isn't known.tokenizersWithTS returns a mapping from a production name to a production tokenizer (that takes a t argument).6tokenizerWithT name t+ converts the production (that requires an t argument) with the specified name to a simple , or Nothing if it isn't known.tokenizersWithNCT returns a mapping from a production name to a production tokenizer (that requires n and c arguments).7tokenizerWithNC name n c( converts the production (that requires n and c arguments) with the specified name to a simple , or Nothing if it isn't known.tokenizersWithNTT returns a mapping from a production name to a production tokenizer (that requires n and t arguments).8tokenizerWithNT name n t( converts the production (that requires n and t arguments) with the specified name to a simple , or Nothing if it isn't known.9tokenizerNames2 returns the list of all productions (tokenizers).detect_utf_encoding doesn't actually detect the encoding, we just call it this way to make the productions compatible with the spec. Instead it simply reports the encoding (which was already detected when we started parsing).nai is the "non-applicable" indentation value. We use Haskell's laziness to verify it really is never used. asInteger] returns the last consumed character, which is assumed to be a decimal digit, as an integer. result value is the same as  return values except that we give the Haskell type deduction the additional boost it needs to figure out this is wrapped in a V.: read chomp converts a  to a .; show chomp converts a  to a .< read context converts a  to a '. We trust our callers to convert any - characters into _ to allow the built-in lex5 function to handle the names as single identifiers.= show context converts a  to a .>Allow using the do< notation for our parsers, which makes for short and sweet doA syntax when we want to examine the results (we typically don't).?-Needed due to the Applicative Monad Proposal.@-Needed due to the Applicative Monad Proposal.A We convert B to a parser for a sequence of characters (that returns nothing).B We convert a A tuple to a parser for a character range (that returns nothing).C We convert 4 to a parser for a character (that returns nothing).DWe don't need to convert a V, it already is one.H show token converts a T to two YEAST lines: a comment with the position numbers and the actual token line.I show code converts a _ to the one-character YEAST token code char. The list of byte codes is also documented in the  yaml2yeast program.J show encoding converts an z= to the encoding name (with a "-") as used by most programs.LMNOPQRSTUWXYZ[\]^_`abcdefghijkmnoplqrsVtuvwxy  !"#$%&'()*+,-./0z{|}~123456789      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~:;<=>?@ABCDEFGHIJ:.  !"#$%&'()*+,-/0123456789:  !"#$%&'()*+,-./0234567891_LMNOPQRSTUWXYZ[\]^_`abcdefghijkmnoplqrsVtuvwxy,  !"#$%&'()*+,-./0z{|}~123456789      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~:;<=>?@ABCDEFGHIJ66779 333330000321000      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrsntuvwxyz{|}~YmX      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~+YamlReference-0.10.0-CKqrADJMNWgKLpFtSr0PrGText.Yaml.Reference TokenizerChompContextTokenCodeBomTextMetaBreakLineFeedLineFold IndicatorWhiteIndent DirectivesEnd DocumentEnd BeginEscape EndEscape BeginComment EndCommentBeginDirective EndDirectiveBeginTagEndTag BeginHandle EndHandle BeginAnchor EndAnchorBeginProperties EndProperties BeginAliasEndAlias BeginScalar EndScalar BeginSequence EndSequence BeginMapping EndMapping BeginPairEndPair BeginNodeEndNode BeginDocument EndDocument BeginStream EndStreamErrorUnparsedDetected showTokensyaml tokenizertokenizerWithNtokenizerWithCtokenizerWithTtokenizerWithNCtokenizerWithNTtokenizerNames $fReadChomp $fShowChomp $fReadContext $fShowContext $fMonadParser$fApplicativeParser$fFunctorParser $fMatch[]() $fMatch(,)() $fMatchChar()$fMatchParserresult $fShowState $fShowReply $fShowResult $fShowToken $fShowCode$fShowEncoding$fEqCodeStripClipKeepBlockOutBlockInFlowOutFlowInBlockKeyFlowKeyMatchParserStatesName sEncoding sDecisionsLimit sForbiddensIsPeeksIsSolsCharssCharsByteOffsetsCharsCharOffset sCharsLinesCharsLineChar sByteOffset sCharOffsetsLine sLineCharsCodesLastsInputReplyResultrResultrTokensrCommitrStateFailedMore tByteOffset tCharOffsettLine tLineChartCodetTextEncodingUTF8UTF16LEUTF16BEUTF32LEUTF32BE.+.-.*./|>decodedetectEncoding undoEncoding hasFewerThan undoUTF32LE undoUTF32BE combinePairs combineLeadsurrogateOffsetcombineSurrogates undoUTF16LE undoUTF16BEundoUTF8 decodeTwoUTF8combineTwoUTF8decodeThreeUTF8combineThreeUTF8decodeFourUTF8combineFourUTF8 escapeStringtoHex initialState setDecisionsetLimit setForbiddensetCode returnReply tokenReply failReplyunexpectedReply%<%^!?!?!-&/?*+decidechoicerecoveryprevpeekrejectuptononEmptyemptyeofsolcommitnextLinewith forbidding limitedTonextIf finishTokenwrapconsumetokenfakemeta indicatortext emptyToken wrapTokensprefixErrorWithpatternTokenizerparserTokenizer errorTokens commitBugspName tokenizerstokenizersWithNtokenizersWithCtokenizersWithTtokenizersWithNCtokenizersWithNTbomna asIntegerresultbaseGHC.BaseStringghc-prim GHC.TypesCharmatchPattern c_printablenb_jsonc_byte_order_markc_sequence_entry c_mapping_keyc_mapping_valuec_collect_entryc_sequence_startc_sequence_endc_mapping_start c_mapping_end c_commentc_anchorc_aliasc_tag c_literalc_foldedc_single_quotec_double_quote c_directive c_reserved c_indicatorc_flow_indicator b_line_feedb_carriage_returnb_charnb_charb_breakb_as_line_feed b_non_contents_spaces_tabs_whitens_char ns_dec_digit ns_hex_digitns_ascii_letter ns_word_char ns_uri_char ns_tag_charc_escape ns_esc_null ns_esc_bellns_esc_backspacens_esc_horizontal_tabns_esc_line_feedns_esc_vertical_tabns_esc_form_feedns_esc_carriage_return ns_esc_escape ns_esc_spacens_esc_double_quote ns_esc_slashns_esc_backslashns_esc_next_linens_esc_non_breaking_spacens_esc_line_separatorns_esc_paragraph_separator ns_esc_8_bit ns_esc_16_bit ns_esc_32_bit c_ns_esc_chars_indent s_indent_lt s_indent_les_separate_in_line s_line_prefixs_block_line_prefixs_flow_line_prefixl_empty b_l_trimmed b_as_space b_l_folded s_flow_foldedc_nb_comment_text b_comment s_b_comment l_comment s_l_comments s_separates_separate_lines l_directivens_reserved_directivens_directive_namens_directive_parameterns_yaml_directivens_yaml_versionns_tag_directive c_tag_handlec_primary_tag_handlec_secondary_tag_handlec_named_tag_handle ns_tag_prefixc_ns_local_tag_prefixns_global_tag_prefixc_ns_propertiesc_ns_tag_propertyc_verbatim_tagc_ns_shorthand_tagc_non_specific_tagc_ns_anchor_propertyns_anchor_charns_anchor_namec_ns_alias_nodee_scalare_nodenb_double_charns_double_charc_double_quotednb_double_textnb_double_one_lines_double_escapeds_double_breaknb_ns_double_in_lines_double_next_linenb_double_multi_linec_quoted_quotenb_single_charns_single_charc_single_quotednb_single_textnb_single_one_linenb_ns_single_in_lines_single_next_linenb_single_multi_linens_plain_first ns_plain_safens_plain_safe_outns_plain_safe_in ns_plain_charns_plainnb_ns_plain_in_linens_plain_one_lines_ns_plain_next_linens_plain_multi_linein_flowc_flow_sequencens_s_flow_seq_entriesns_flow_seq_entryc_flow_mappingns_s_flow_map_entriesns_flow_map_entryns_flow_map_explicit_entryns_flow_map_implicit_entryns_flow_map_yaml_key_entryc_ns_flow_map_empty_key_entryc_ns_flow_map_separate_valuec_ns_flow_map_json_key_entryc_ns_flow_map_adjacent_value ns_flow_pairns_flow_pair_entryns_flow_pair_yaml_key_entryc_ns_flow_pair_json_key_entryns_s_implicit_yaml_keyc_s_implicit_json_keyns_flow_yaml_contentc_flow_json_contentns_flow_contentns_flow_yaml_nodec_flow_json_node ns_flow_nodec_b_block_headerc_indentation_indicatordetect_scalar_indentation count_spacesc_chomping_indicatorend_block_scalarb_chomped_lastl_chomped_empty l_strip_empty l_keep_emptyl_trail_comments c_l__literall_nb_literal_textb_nb_literal_nextl_literal_content c_l__foldeds_nb_folded_textl_nb_folded_liness_nb_spaced_text b_l_spacedl_nb_spaced_linesl_nb_same_linesl_nb_diff_linesl_folded_contentdetect_collection_indentationdetect_inline_indentationl__block_sequencec_l_block_seq_entrys_l__block_indentedns_l_in_line_sequencel__block_mappingns_l_block_map_entryc_l_block_map_explicit_entryc_l_block_map_explicit_keyl_block_map_explicit_valuens_l_block_map_implicit_entryns_s_block_map_implicit_keyc_l_block_map_implicit_valuens_l_in_line_mappingunparsedunparsed_indent unparsed_textunparsed_breaks_l__block_nodes_l__flow_in_blocks_l__block_in_blocks_l__block_scalars_l__block_collection seq_spacesl_document_prefixc_directives_endc_document_endl_document_suffix c_forbiddenl_bare_documentl_explicit_documentl_directives_documentl_any_document l_yaml_stream