Skip to content

Commit

Permalink
refactor: drop peg strace parser
Browse files Browse the repository at this point in the history
  • Loading branch information
desbma committed Dec 25, 2024
1 parent 2ca1c42 commit 5f1a98c
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 800 deletions.
15 changes: 3 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,34 @@ env:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
strace-parser: [combinator, peg]
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- run: cargo build --no-default-features --features strace-parser-${{matrix.strace-parser}} --verbose
- run: cargo build --verbose

test:
runs-on: ubuntu-latest
strategy:
matrix:
strace-parser: [combinator, peg]
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- run: cargo test --bins --no-default-features --features strace-parser-${{matrix.strace-parser}} --verbose
- run: cargo test --verbose

clippy:
runs-on: ubuntu-latest
strategy:
matrix:
strace-parser: [combinator, peg]
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: clippy
- run: cargo clippy --no-default-features --features strace-parser-${{matrix.strace-parser}} -- -D warnings
- run: cargo clippy -- -D warnings

fmt:
runs-on: ubuntu-latest
Expand Down
146 changes: 1 addition & 145 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 3 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ strip = true
anyhow = { version = "1.0.93", default-features = false, features = ["std", "backtrace"] }
bincode = { version = "1.3.3", default-features = false }
clap = { version = "4.5.21", default-features = false, features = ["std", "color", "help", "usage", "error-context", "suggestions", "derive"] }
function_name = { version = "0.3.0", default-features = false, optional = true }
function_name = { version = "0.3.0", default-features = false }
itertools = { version = "0.13.0", default-features = false, features = ["use_std"] }
log = { version = "0.4.22", default-features = false, features = ["max_level_trace", "release_max_level_info"] }
nix = { version = "0.29.0", default-features = false, features = ["fs"] }
nom = { version = "7.1.3", default-features = false, features = ["std"], optional = true }
pest = { version = "2.7.14", default-features = false, features = ["std", "memchr"], optional = true }
pest_derive = { version = "2.7.14", default-features = false, features = ["std"], optional = true}
nom = { version = "7.1.3", default-features = false, features = ["std"] }
rand = { version = "0.8.5", default-features = false, features = ["std", "std_rng"] }
regex = { version = "1.11.1", default-features = false, features = ["std", "perf"] }
serde = { version = "1.0.215", default-features = false, features = ["std", "derive"] }
Expand All @@ -38,11 +36,9 @@ predicates = { version = "3.1.2", default-features = false, features = ["color"]
pretty_assertions = { version = "1.4.1", default-features = false, features = ["std"] }

[features]
default = ["strace-parser-combinator"]
default = []
as-root = [] # for tests only
nightly = [] # for benchmarks only
strace-parser-combinator = ["dep:function_name", "dep:nom"]
strace-parser-peg = ["dep:pest", "dep:pest_derive"]

[lints.rust]
# https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html
Expand Down
7 changes: 0 additions & 7 deletions src/strace/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,8 @@ use std::{

use crate::strace::Syscall;

#[cfg(feature = "strace-parser-combinator")]
mod combinator;
#[cfg(feature = "strace-parser-peg")]
mod peg;

#[cfg(feature = "strace-parser-combinator")]
use combinator::parse_line;
#[cfg(feature = "strace-parser-peg")]
use peg::parse_line;

use super::{Expression, SyscallRetVal};

Expand Down
Loading

0 comments on commit 5f1a98c

Please sign in to comment.