Skip to content

Instantly share code, notes, and snippets.

@ollien
Last active October 30, 2021 22:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ollien/4e1ba081e332b22423275d7b1564fffe to your computer and use it in GitHub Desktop.
Save ollien/4e1ba081e332b22423275d7b1564fffe to your computer and use it in GitHub Desktop.
[~/Documents/code/pest-json] nick@cubert$ cargo build
Compiling pest-json v0.1.0 (/home/nick/Documents/code/pest-json)
error[E0433]: failed to resolve: use of undeclared type `JsonParser`
--> src/main.rs:3:17
|
3 | let pairs = JsonParser::parse();
| ^^^^^^^^^^ use of undeclared type `JsonParser`
For more information about this error, try `rustc --explain E0433`.
error: could not compile `pest-json` due to previous error
[~/Documents/code/pest-json] nick@cubert$ cargo build
Compiling pest-json v0.1.0 (/home/nick/Documents/code/pest-json)
error[E0412]: cannot find type `Error` in crate `pest`
--> src/parse.rs:9:10
|
9 | #[derive(Parser)]
| ^^^^^^ not found in `pest`
|
= note: this error originates in the derive macro `Parser` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing one of these items
|
1 | use std::error::Error;
|
1 | use std::fmt::Error;
|
1 | use std::io::Error;
|
warning: unused import: `pest::Parser`
--> src/parse.rs:1:5
|
1 | use pest::Parser;
| ^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
error[E0593]: closure is expected to take 1 argument, but it takes 2 arguments
--> src/parse.rs:9:10
|
9 | #[derive(Parser)]
| ^^^^^^
| |
| expected closure that takes 1 argument
| takes 2 arguments
|
= note: this error originates in the derive macro `Parser` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: no method named `rule` found for mutable reference `&mut ParserState<'i, Rule>` in the current scope
--> src/parse.rs:9:10
|
9 | #[derive(Parser)]
| ^^^^^^ method not found in `&mut ParserState<'i, Rule>`
|
= note: this error originates in the derive macro `Parser` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: no method named `sequence` found for mutable reference `&mut ParserState<'_, Rule>` in the current scope
--> src/parse.rs:9:10
|
9 | #[derive(Parser)]
| ^^^^^^ method not found in `&mut ParserState<'_, Rule>`
|
= note: this error originates in the derive macro `Parser` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0624]: associated function `match_range` is private
--> src/parse.rs:9:10
|
9 | #[derive(Parser)]
| ^^^^^^ private associated function
|
::: /home/nick/.cargo/registry/src/github.com-1ecc6299db9ec823/pest-2.1.3/src/position.rs:378:5
|
378 | pub(crate) fn match_range(&mut self, range: Range<char>) -> bool {
| ---------------------------------------------------------------- private associated function defined here
|
= note: this error originates in the derive macro `Parser` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0624]: associated function `match_string` is private
--> src/parse.rs:9:10
|
9 | #[derive(Parser)]
| ^^^^^^ private associated function
|
::: /home/nick/.cargo/registry/src/github.com-1ecc6299db9ec823/pest-2.1.3/src/position.rs:343:5
|
343 | pub(crate) fn match_string(&mut self, string: &str) -> bool {
| ----------------------------------------------------------- private associated function defined here
|
= note: this error originates in the derive macro `Parser` (in Nightly builds, run with -Z macro-backtrace for more info)
Some errors have detailed explanations: E0412, E0593, E0599, E0624.
For more information about an error, try `rustc --explain E0412`.
warning: `pest-json` (lib) generated 1 warning
error: could not compile `pest-json` due to 6 previous errors; 1 warning emitted
use pest_derive::Parser;
enum JsonValue {
Null,
Number(f64),
}
#[derive(Parser)]
#[grammar = "../grammars/json.pest"]
struct JsonParser;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment