trivet 3.0.0

The trivet Parser Library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Migration Guide

These are notes on migrating from a prior major version of Trivet.

## 1.0 to 2.0

- Use `trivet::Parser` instead of `trivet::parser::Parser`
- The `trivet::Parser` does not need a generic type; remove `<R: Read>`
- The `trivet::Parser.peek()` method always returns a `char`; use `Parser.is_at_eof()` to check for end of file
- Most methods in `trviet::Parser` no longer return `trivet::parser::ParseResult` and no longer require checking
- Use `trivet::errors::ParseResult` in place of `trivet::parser::ParseResult`
- Use `trivet::errors::ParseError` in place of `trivet::parser::ParseError`
- There are several string parsing methods in `trivet::Parser`; the one closest to the old `parse_string` method is `parse_string_match_delimiter`
- Find `parse_from_string` and friends in the root: `trivet::parse_from_string`
- Replace `consume_comments_and_whitespace` with `trivet::Parser.consume_ws`
- Replace `consume_comments` with `trivet::Parser.consume_ws`
- The error methods, such as `syntax_error`, are not in `trivet::Parser`; find them in `trivet::errors` and note that they require a `trivet::Loc` as the first argument