Skip to content

Commit 79555cf

Browse files
committed
Fix some doc comments that were out of date after the latest commit
1 parent 7100cb3 commit 79555cf

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

mecha.zig

+7-3
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,17 @@ pub fn Parser(comptime _T: type) type {
3333
};
3434
}
3535

36-
/// The result of a parse where `ok` corresponds to a successful parse
36+
/// The result of a parse. where `ok` corresponds to a successful parse
3737
/// and `err` denotes a failure. The result will be placed in `value`
3838
/// and `rest` will contain the unparsed input. On error, `pos` will contain
3939
/// the position where the parser stopped and the next parser can pick up.
4040
pub fn Result(comptime T: type) type {
4141
return struct {
42+
/// An index into the input string pointing to the end of what was parsed.
4243
index: usize,
44+
45+
/// The value parsed. Can either be `ok`, meaning parsing was successful, or `err` meaning
46+
/// the string could not be parsed.
4347
value: union(enum) {
4448
ok: T,
4549
err,
@@ -463,9 +467,9 @@ test "combine" {
463467

464468
/// Takes a tuple of `Parser(T)` and constructs a parser that
465469
/// succeeds when at least one of the child parsers succeeds.
466-
/// Note that /// parsers will be called in order, with `str`
470+
/// Note that parsers will be called in order, with `str`
467471
/// as input. The parser will return with the type of the first
468-
// child parser and the result of the first child parser
472+
/// child parser and the result of the first child parser
469473
/// that succeeds. The parser result will be `Result(T)`.
470474
pub fn oneOf(comptime parsers: anytype) Parser(ParserResult(@TypeOf(parsers[0]))) {
471475
inline for (parsers) |parser|

0 commit comments

Comments
 (0)