Reads the next token and reads it as true or false, in either case. The second result is false
when the token is anything else or there is none; the token is removed from line anyway.
parse_bool :: (
line: *string,
delimiters := DEFAULT_DELIMITERS,
spaces := DEFAULT_SPACES
) -> (value: bool, success: bool)
Parameters
- line: *string
- delimiters := DEFAULT_DELIMITERS
- spaces := DEFAULT_SPACES
Returns
- value: bool
- success: bool
line := "True rest";
value, ok := parse_bool(*line);
assert(ok && value && line == " rest");