Remove Parse trait (#6235)

This commit is contained in:
Micha Reiser
2023-08-01 18:35:03 +02:00
committed by GitHub
parent 83fe103d6e
commit debfca3a11
25 changed files with 235 additions and 1420 deletions

View File

@@ -4,9 +4,8 @@
#![no_main]
use libfuzzer_sys::{fuzz_target, Corpus};
use ruff_python_ast::Suite;
use ruff_python_codegen::{Generator, Stylist};
use ruff_python_parser::{lexer, Mode, Parse, ParseError};
use ruff_python_parser::{lexer, parse_suite, Mode, ParseError};
use ruff_source_file::Locator;
fn do_fuzz(case: &[u8]) -> Corpus {
@@ -16,7 +15,7 @@ fn do_fuzz(case: &[u8]) -> Corpus {
// just round-trip it once to trigger both parse and unparse
let locator = Locator::new(code);
let python_ast = match Suite::parse(code, "fuzzed-source.py") {
let python_ast = match parse_suite(code, "fuzzed-source.py") {
Ok(stmts) => stmts,
Err(ParseError { offset, .. }) => {
let offset = offset.to_usize();