var searchIndex = {}; searchIndex["parser_combinators"] = {"doc":"This crate contains parser combinators, roughly based on the Haskell library [parsec](http://hackage.haskell.org/package/parsec).","items":[[3,"ParseError","parser_combinators","Struct which hold information about an error that occured at a specific position.\nCan hold multiple instances of `Error` if more that one error occured at the position.",null,null],[12,"position","","The position where the error occured",0,null],[12,"errors","","A vector containing specific information on what errors occured at `position`",0,null],[5,"from_iter","","Converts an `Iterator` into a stream.",null,{"inputs":[{"name":"i"}],"output":{"name":"iteratorstream"}}],[5,"any_char","","Parses any character",null,{"inputs":[{"name":"state"}],"output":{"name":"parseresult"}}],[5,"digit","","Parses a digit from a stream containing characters",null,{"inputs":[],"output":{"name":"digit"}}],[5,"space","","Parses whitespace",null,{"inputs":[],"output":{"name":"space"}}],[5,"spaces","","Skips over zero or more spaces",null,{"inputs":[],"output":{"name":"spaces"}}],[5,"newline","","Parses a newline character",null,{"inputs":[],"output":{"name":"newline"}}],[5,"crlf","","Parses carriage return and newline, returning the newline character.",null,{"inputs":[],"output":{"name":"crlf"}}],[5,"tab","","Parses a tab character",null,{"inputs":[],"output":{"name":"tab"}}],[5,"upper","","Parses an uppercase letter",null,{"inputs":[],"output":{"name":"upper"}}],[5,"lower","","Parses an lowercase letter",null,{"inputs":[],"output":{"name":"lower"}}],[5,"letter","","Parses an alphabet letter",null,{"inputs":[],"output":{"name":"letter"}}],[5,"alpha_num","","Parses either an alphabet letter or digit",null,{"inputs":[],"output":{"name":"alphanum"}}],[5,"hex_digit","","Parses a hexdecimal digit with uppercase and lowercase",null,{"inputs":[],"output":{"name":"hexdigit"}}],[5,"oct_digit","","Parses an octal digit",null,{"inputs":[],"output":{"name":"octdigit"}}],[5,"string","","Parses the string `s`",null,{"inputs":[{"name":"str"}],"output":{"name":"string"}}],[5,"satisfy","","Parses a character and succeeds depending on the result of `pred`",null,{"inputs":[{"name":"pred"}],"output":{"name":"satisfy"}}],[5,"between","","Parses `open` followed by `parser` followed by `close`\nReturns the value of `parser`",null,{"inputs":[{"name":"l"},{"name":"r"},{"name":"p"}],"output":{"name":"between"}}],[5,"chainl1","","Parses `p` 1 or more times separated by `op`\nThe value returned is the one produced by the left associative application of `op`",null,{"inputs":[{"name":"p"},{"name":"op"}],"output":{"name":"chainl1"}}],[5,"choice","","Takes an array of parsers and tries them each in turn.\nFails if all parsers fails or when a parsers fails with a consumed state.",null,{"inputs":[{"name":"s"}],"output":{"name":"choice"}}],[5,"many","","Parses `p` zero or more times returning a collection with the values from `p`.\nIf the returned collection cannot be inferred type annotations must be supplied, either by\nannotating the resulting type binding `let collection: Vec<_> = ...` or by specializing when\ncalling many, `many::<Vec<_>, _>(...)`",null,{"inputs":[{"name":"p"}],"output":{"name":"many"}}],[5,"many1","","Parses `p` one or more times returning a collection with the values from `p`.\nIf the returned collection cannot be inferred type annotations must be supplied, either by\nannotating the resulting type binding `let collection: Vec<_> = ...` or by specializing when\ncalling many1 `many1::<Vec<_>, _>(...)`",null,{"inputs":[{"name":"p"}],"output":{"name":"many1"}}],[5,"optional","","Returns `Some(value)` and `None` on parse failure (always succeeds)",null,{"inputs":[{"name":"p"}],"output":{"name":"optional"}}],[5,"parser","","Wraps a function, turning it into a parser\nMainly needed to turn closures into parsers as function types can be casted to function pointers\nto make them usable as a parser",null,{"inputs":[{"name":"f"}],"output":{"name":"fnparser"}}],[5,"sep_by","","Parses `parser` zero or more time separated by `separator`, returning a collection with the values from `p`.\nIf the returned collection cannot be inferred type annotations must be supplied, either by\nannotating the resulting type binding `let collection: Vec<_> = ...` or by specializing when\ncalling sep_by, `sep_by::<Vec<_>, _, _>(...)`",null,{"inputs":[{"name":"p"},{"name":"s"}],"output":{"name":"sepby"}}],[5,"skip_many","","Parses `p` zero or more times ignoring the result",null,{"inputs":[{"name":"p"}],"output":{"name":"skipmany"}}],[5,"skip_many1","","Parses `p` one or more times ignoring the result",null,{"inputs":[{"name":"p"}],"output":{"name":"skipmany1"}}],[5,"try","","Try acts as `p` except it acts as if the parser hadn't consumed any input\nif `p` returns an error after consuming input",null,{"inputs":[{"name":"p"}],"output":{"name":"try"}}],[5,"value","","Always returns the value `v` without consuming any input.",null,{"inputs":[{"name":"t"}],"output":{"name":"value"}}],[5,"unexpected","","Always fails with `message` as the error.\nNever consumes any input.",null,{"inputs":[{"name":"s"}],"output":{"name":"unexpected"}}],[5,"not_followed_by","","Succeeds only if `parser` fails.\nNever consumes any input.",null,{"inputs":[{"name":"p"}],"output":{"name":"notfollowedby"}}],[0,"primitives","","Module containing the primitive types which is used to create and compose more advanced parsers",null,null],[3,"SourcePosition","parser_combinators::primitives","Struct which represents the positions in the source file",null,null],[12,"line","","Current line of the input",1,null],[12,"column","","Current column of the input",1,null],[3,"ParseError","","Struct which hold information about an error that occured at a specific position.\nCan hold multiple instances of `Error` if more that one error occured at the position.",null,null],[12,"position","","The position where the error occured",0,null],[12,"errors","","A vector containing specific information on what errors occured at `position`",0,null],[3,"State","","The `State<I>` struct keeps track of the current position in the stream `I`",null,null],[12,"position","","",2,null],[12,"input","","",2,null],[3,"IteratorStream","","",null,null],[4,"Error","","Enum used to store information about an error that has occured",null,null],[13,"Unexpected","","Error indicating an unexpected token has been encountered in the stream",3,null],[13,"Expected","","Error indicating that the parser expected something else",3,null],[13,"Message","","Generic message",3,null],[13,"Other","","Variant for containing other types of errors",3,null],[4,"Consumed","","Enum used to indicate if a parser consumed any items of the stream it was given as an input",null,null],[13,"Consumed","","Constructor indicating that the parser has consumed elements",4,null],[13,"Empty","","Constructor indicating that the parser did not consume any elements",4,null],[5,"from_iter","","Converts an `Iterator` into a stream.",null,{"inputs":[{"name":"i"}],"output":{"name":"iteratorstream"}}],[6,"ParseResult","","A type alias over the specific `Result` type used by parsers to indicate wether they were\nsuccessful or not.\n`O` is the type that is output on success\n`I` is the specific stream type used in the parser",null,null],[8,"Stream","","A stream is a sequence of items that can be extracted one by one",null,null],[16,"Item","","",5,null],[10,"uncons","","Takes a stream and removes its first item, yielding the item and the rest of the elements\nReturns `Err` when no more elements could be retrieved",5,null],[8,"Parser","","By implementing the `Parser` trait a type says that it can be used to parse an input stream into\nthe type `Output`.",null,null],[16,"Input","","A type implementing the `Stream` trait which is the specific type\nthat is parsed.",6,null],[16,"Output","","The type which is returned when the parsing is successful.",6,null],[11,"parse","","Entrypoint of the parser\nTakes some input and tries to parse it returning a `ParseResult`",6,null],[10,"parse_state","","Parses using the state `input` by calling Stream::uncons one or more times\nOn success returns `Ok((value, new_state))` on failure it returns `Err(error)`",6,null],[11,"partial_cmp","","",1,null],[11,"lt","","",1,null],[11,"le","","",1,null],[11,"gt","","",1,null],[11,"ge","","",1,null],[11,"cmp","","",1,null],[11,"eq","","",1,null],[11,"ne","","",1,null],[11,"fmt","","",1,null],[11,"clone","","",1,null],[11,"fmt","","",3,null],[11,"eq","","",3,null],[11,"from","","",3,{"inputs":[{"name":"e"}],"output":{"name":"error"}}],[11,"fmt","","",4,null],[11,"eq","","",4,null],[11,"ne","","",4,null],[11,"clone","","",4,null],[11,"is_empty","","Returns true if `self` is empty",4,null],[11,"into_inner","","Extracts the contained value",4,null],[11,"as_consumed","","Converts `self` into the Consumed state",4,null],[11,"as_empty","","Converts `self` into theEmpty state",4,null],[11,"map","","Maps over the contained value without changing the consumed state",4,null],[11,"combine","","Combines the Consumed flags from `self` and the result of `f`",4,null],[11,"eq","","",0,null],[11,"ne","","",0,null],[11,"fmt","","",0,null],[11,"new","","",0,{"inputs":[{"name":"sourceposition"},{"name":"error"}],"output":{"name":"parseerror"}}],[11,"add_message","","",0,null],[11,"add_error","","",0,null],[11,"set_expected","","",0,null],[11,"merge","","",0,null],[11,"description","","",0,null],[11,"fmt","","",0,null],[11,"fmt","","",1,null],[11,"fmt","","",3,null],[11,"fmt","","",2,null],[11,"eq","","",2,null],[11,"ne","","",2,null],[11,"clone","","",2,null],[11,"new","","",2,{"inputs":[{"name":"i"}],"output":{"name":"state"}}],[11,"as_empty","","",2,null],[11,"uncons","","`uncons` is the most general way of extracting and item from a stream\nIt takes a function `f` as argument which should update the position\naccording to the item that was extracted\nUsually you want to use `uncons_char` instead which works directly on character streams",2,null],[11,"uncons_char","","Specialized uncons function for character streams which updates the position\nwith no further action needed",2,null],[11,"fmt","","",7,null],[11,"clone","","",7,null],[11,"uncons","","",7,null],[0,"combinator","parser_combinators","Module containing all specific parsers",null,null],[3,"Choice","parser_combinators::combinator","",null,null],[3,"Unexpected","","",null,null],[3,"Value","","",null,null],[3,"NotFollowedBy","","",null,null],[3,"Many","","",null,null],[3,"Many1","","",null,null],[3,"SkipMany","","",null,null],[3,"SkipMany1","","",null,null],[3,"SepBy","","",null,null],[3,"FnParser","","",null,null],[3,"Optional","","",null,null],[3,"Between","","",null,null],[3,"Chainl1","","",null,null],[3,"Chainr1","","",null,null],[3,"Try","","",null,null],[3,"And","","",null,null],[3,"With","","",null,null],[3,"Skip","","",null,null],[3,"Message","","",null,null],[3,"Or","","",null,null],[3,"Map","","",null,null],[3,"Then","","",null,null],[3,"Expected","","",null,null],[3,"AndThen","","",null,null],[5,"choice","","Takes an array of parsers and tries them each in turn.\nFails if all parsers fails or when a parsers fails with a consumed state.",null,{"inputs":[{"name":"s"}],"output":{"name":"choice"}}],[5,"unexpected","","Always fails with `message` as the error.\nNever consumes any input.",null,{"inputs":[{"name":"s"}],"output":{"name":"unexpected"}}],[5,"value","","Always returns the value `v` without consuming any input.",null,{"inputs":[{"name":"t"}],"output":{"name":"value"}}],[5,"not_followed_by","","Succeeds only if `parser` fails.\nNever consumes any input.",null,{"inputs":[{"name":"p"}],"output":{"name":"notfollowedby"}}],[5,"many","","Parses `p` zero or more times returning a collection with the values from `p`.\nIf the returned collection cannot be inferred type annotations must be supplied, either by\nannotating the resulting type binding `let collection: Vec<_> = ...` or by specializing when\ncalling many, `many::<Vec<_>, _>(...)`",null,{"inputs":[{"name":"p"}],"output":{"name":"many"}}],[5,"skip_many","","Parses `p` zero or more times ignoring the result",null,{"inputs":[{"name":"p"}],"output":{"name":"skipmany"}}],[5,"skip_many1","","Parses `p` one or more times ignoring the result",null,{"inputs":[{"name":"p"}],"output":{"name":"skipmany1"}}],[5,"many1","","Parses `p` one or more times returning a collection with the values from `p`.\nIf the returned collection cannot be inferred type annotations must be supplied, either by\nannotating the resulting type binding `let collection: Vec<_> = ...` or by specializing when\ncalling many1 `many1::<Vec<_>, _>(...)`",null,{"inputs":[{"name":"p"}],"output":{"name":"many1"}}],[5,"sep_by","","Parses `parser` zero or more time separated by `separator`, returning a collection with the values from `p`.\nIf the returned collection cannot be inferred type annotations must be supplied, either by\nannotating the resulting type binding `let collection: Vec<_> = ...` or by specializing when\ncalling sep_by, `sep_by::<Vec<_>, _, _>(...)`",null,{"inputs":[{"name":"p"},{"name":"s"}],"output":{"name":"sepby"}}],[5,"parser","","Wraps a function, turning it into a parser\nMainly needed to turn closures into parsers as function types can be casted to function pointers\nto make them usable as a parser",null,{"inputs":[{"name":"f"}],"output":{"name":"fnparser"}}],[5,"optional","","Returns `Some(value)` and `None` on parse failure (always succeeds)",null,{"inputs":[{"name":"p"}],"output":{"name":"optional"}}],[5,"between","","Parses `open` followed by `parser` followed by `close`\nReturns the value of `parser`",null,{"inputs":[{"name":"l"},{"name":"r"},{"name":"p"}],"output":{"name":"between"}}],[5,"chainl1","","Parses `p` 1 or more times separated by `op`\nThe value returned is the one produced by the left associative application of `op`",null,{"inputs":[{"name":"p"},{"name":"op"}],"output":{"name":"chainl1"}}],[5,"chainr1","","Parses `p` one or more times separated by `op`\nThe value returned is the one produced by the right associative application of `op`",null,{"inputs":[{"name":"p"},{"name":"op"}],"output":{"name":"chainr1"}}],[5,"try","","Try acts as `p` except it acts as if the parser hadn't consumed any input\nif `p` returns an error after consuming input",null,{"inputs":[{"name":"p"}],"output":{"name":"try"}}],[8,"ParserExt","","Extension trait which provides functions that are more conveniently used through method calls",null,null],[11,"with","","Discards the value of the `self` parser and returns the value of `p`\nFails if any of the parsers fails",8,null],[11,"skip","","Discards the value of the `p` parser and returns the value of `self`\nFails if any of the parsers fails",8,null],[11,"and","","Parses with `self` followed by `p`\nSucceds if both parsers succed, otherwise fails\nReturns a tuple with both values on success",8,null],[11,"or","","Tries to parse using `self` and if it fails returns the result of parsing `p`",8,null],[11,"then","","Parses using `self` and then passes the value to `f` which returns a parser used to parse\nthe rest of the input",8,null],[11,"map","","Uses `f` to map over the parsed value",8,null],[11,"message","","Parses with `self` and if it fails, adds the message `msg` to the error",8,null],[11,"expected","","Parses with `self` and if it fails without consuming any input any expected errors are replaced by\n`msg`. `msg` is then used in error messages as "Expected `msg`".",8,null],[11,"and_then","","Parses with `self` and applies `f` on the result if `self` parses successfully\n`f` may optionally fail with an error which is automatically converted to a `ParseError`",8,null],[11,"parse_state","","",9,null],[11,"clone","","",10,null],[11,"parse_state","","",10,null],[11,"clone","","",11,null],[11,"parse_state","","",11,null],[11,"clone","","",12,null],[11,"parse_state","","",12,null],[11,"clone","","",13,null],[11,"parse_state","","",13,null],[11,"clone","","",14,null],[11,"parse_state","","",14,null],[11,"clone","","",15,null],[11,"parse_state","","",15,null],[11,"clone","","",16,null],[11,"parse_state","","",16,null],[11,"clone","","",17,null],[11,"parse_state","","",17,null],[11,"clone","","",18,null],[11,"parse_state","","",18,null],[11,"clone","","",19,null],[11,"parse_state","","",19,null],[11,"clone","","",20,null],[11,"parse_state","","",20,null],[11,"clone","","",21,null],[11,"parse_state","","",21,null],[11,"clone","","",22,null],[11,"parse_state","","",22,null],[11,"clone","","",23,null],[11,"parse_state","","",23,null],[11,"clone","","",24,null],[11,"parse_state","","",24,null],[11,"clone","","",25,null],[11,"parse_state","","",25,null],[11,"clone","","",26,null],[11,"parse_state","","",26,null],[11,"clone","","",27,null],[11,"parse_state","","",27,null],[11,"clone","","",28,null],[11,"parse_state","","",28,null],[11,"clone","","",29,null],[11,"parse_state","","",29,null],[11,"clone","","",30,null],[11,"parse_state","","",30,null],[11,"clone","","",31,null],[11,"parse_state","","",31,null],[11,"parse_state","","",32,null],[0,"char","parser_combinators","Module containg parsers specialized on character streams",null,null],[3,"Satisfy","parser_combinators::char","",null,null],[3,"Digit","","",null,null],[3,"Space","","",null,null],[3,"Spaces","","",null,null],[3,"NewLine","","",null,null],[3,"CrLf","","",null,null],[3,"Tab","","",null,null],[3,"Upper","","",null,null],[3,"Lower","","",null,null],[3,"AlphaNum","","",null,null],[3,"Letter","","",null,null],[3,"OctDigit","","",null,null],[3,"HexDigit","","",null,null],[3,"String","","",null,null],[5,"any_char","","Parses any character",null,{"inputs":[{"name":"state"}],"output":{"name":"parseresult"}}],[5,"satisfy","","Parses a character and succeeds depending on the result of `pred`",null,{"inputs":[{"name":"pred"}],"output":{"name":"satisfy"}}],[5,"digit","","Parses a digit from a stream containing characters",null,{"inputs":[],"output":{"name":"digit"}}],[5,"space","","Parses whitespace",null,{"inputs":[],"output":{"name":"space"}}],[5,"spaces","","Skips over zero or more spaces",null,{"inputs":[],"output":{"name":"spaces"}}],[5,"newline","","Parses a newline character",null,{"inputs":[],"output":{"name":"newline"}}],[5,"crlf","","Parses carriage return and newline, returning the newline character.",null,{"inputs":[],"output":{"name":"crlf"}}],[5,"tab","","Parses a tab character",null,{"inputs":[],"output":{"name":"tab"}}],[5,"upper","","Parses an uppercase letter",null,{"inputs":[],"output":{"name":"upper"}}],[5,"lower","","Parses an lowercase letter",null,{"inputs":[],"output":{"name":"lower"}}],[5,"alpha_num","","Parses either an alphabet letter or digit",null,{"inputs":[],"output":{"name":"alphanum"}}],[5,"letter","","Parses an alphabet letter",null,{"inputs":[],"output":{"name":"letter"}}],[5,"oct_digit","","Parses an octal digit",null,{"inputs":[],"output":{"name":"octdigit"}}],[5,"hex_digit","","Parses a hexdecimal digit with uppercase and lowercase",null,{"inputs":[],"output":{"name":"hexdigit"}}],[5,"string","","Parses the string `s`",null,{"inputs":[{"name":"str"}],"output":{"name":"string"}}],[11,"clone","","",33,null],[11,"parse_state","","",33,null],[11,"clone","","",34,null],[11,"parse_state","","",34,null],[11,"clone","","",35,null],[11,"parse_state","","",35,null],[11,"clone","","",36,null],[11,"parse_state","","",36,null],[11,"clone","","",37,null],[11,"parse_state","","",37,null],[11,"clone","","",38,null],[11,"parse_state","","",38,null],[11,"clone","","",39,null],[11,"parse_state","","",39,null],[11,"clone","","",40,null],[11,"parse_state","","",40,null],[11,"clone","","",41,null],[11,"parse_state","","",41,null],[11,"clone","","",42,null],[11,"parse_state","","",42,null],[11,"clone","","",43,null],[11,"parse_state","","",43,null],[11,"clone","","",44,null],[11,"parse_state","","",44,null],[11,"clone","","",45,null],[11,"parse_state","","",45,null],[11,"clone","","",46,null],[11,"parse_state","","",46,null],[6,"ParseResult","parser_combinators","A type alias over the specific `Result` type used by parsers to indicate wether they were\nsuccessful or not.\n`O` is the type that is output on success\n`I` is the specific stream type used in the parser",null,null],[8,"Parser","","By implementing the `Parser` trait a type says that it can be used to parse an input stream into\nthe type `Output`.",null,null],[16,"Input","","A type implementing the `Stream` trait which is the specific type\nthat is parsed.",6,null],[16,"Output","","The type which is returned when the parsing is successful.",6,null],[11,"parse","","Entrypoint of the parser\nTakes some input and tries to parse it returning a `ParseResult`",6,null],[10,"parse_state","","Parses using the state `input` by calling Stream::uncons one or more times\nOn success returns `Ok((value, new_state))` on failure it returns `Err(error)`",6,null],[8,"ParserExt","","Extension trait which provides functions that are more conveniently used through method calls",null,null],[11,"with","","Discards the value of the `self` parser and returns the value of `p`\nFails if any of the parsers fails",8,null],[11,"skip","","Discards the value of the `p` parser and returns the value of `self`\nFails if any of the parsers fails",8,null],[11,"and","","Parses with `self` followed by `p`\nSucceds if both parsers succed, otherwise fails\nReturns a tuple with both values on success",8,null],[11,"or","","Tries to parse using `self` and if it fails returns the result of parsing `p`",8,null],[11,"then","","Parses using `self` and then passes the value to `f` which returns a parser used to parse\nthe rest of the input",8,null],[11,"map","","Uses `f` to map over the parsed value",8,null],[11,"message","","Parses with `self` and if it fails, adds the message `msg` to the error",8,null],[11,"expected","","Parses with `self` and if it fails without consuming any input any expected errors are replaced by\n`msg`. `msg` is then used in error messages as "Expected `msg`".",8,null],[11,"and_then","","Parses with `self` and applies `f` on the result if `self` parses successfully\n`f` may optionally fail with an error which is automatically converted to a `ParseError`",8,null]],"paths":[[3,"ParseError"],[3,"SourcePosition"],[3,"State"],[4,"Error"],[4,"Consumed"],[8,"Stream"],[8,"Parser"],[3,"IteratorStream"],[8,"ParserExt"],[3,"Choice"],[3,"Unexpected"],[3,"Value"],[3,"NotFollowedBy"],[3,"Many"],[3,"Many1"],[3,"SkipMany"],[3,"SkipMany1"],[3,"SepBy"],[3,"FnParser"],[3,"Optional"],[3,"Between"],[3,"Chainl1"],[3,"Chainr1"],[3,"Try"],[3,"And"],[3,"With"],[3,"Skip"],[3,"Message"],[3,"Or"],[3,"Map"],[3,"Then"],[3,"Expected"],[3,"AndThen"],[3,"Satisfy"],[3,"Digit"],[3,"Space"],[3,"Spaces"],[3,"NewLine"],[3,"CrLf"],[3,"Tab"],[3,"Upper"],[3,"Lower"],[3,"AlphaNum"],[3,"Letter"],[3,"OctDigit"],[3,"HexDigit"],[3,"String"]]}; initSearch(searchIndex);