Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark some compiler structs as public #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/compiler/grammar/actions/action_editheader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use crate::compiler::{
use crate::compiler::grammar::MatchType;

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub(crate) struct AddHeader {
pub struct AddHeader {
pub last: bool,
pub field_name: Value,
pub value: Value,
Expand All @@ -50,7 +50,7 @@ pub(crate) struct AddHeader {

*/
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub(crate) struct DeleteHeader {
pub struct DeleteHeader {
pub index: Option<i32>,
pub comparator: Comparator,
pub match_type: MatchType,
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/grammar/actions/action_fileinto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use crate::compiler::{
};

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub(crate) struct FileInto {
pub struct FileInto {
pub copy: bool,
pub create: bool,
pub folder: Value,
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/grammar/actions/action_keep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use crate::compiler::{
};

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub(crate) struct Keep {
pub struct Keep {
pub flags: Vec<Value>,
}

Expand Down
2 changes: 1 addition & 1 deletion src/compiler/grammar/actions/action_mime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub(crate) struct ExtractText {
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub(crate) enum MimeOpts<T> {
pub enum MimeOpts<T> {
Type,
Subtype,
ContentType,
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/grammar/actions/action_redirect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use crate::compiler::{
};

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub(crate) struct Redirect {
pub struct Redirect {
pub copy: bool,
pub address: Value,
pub notify: Notify,
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/grammar/actions/action_reject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use crate::compiler::{
};

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub(crate) struct Reject {
pub struct Reject {
pub ereject: bool,
pub reason: Value,
}
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/grammar/actions/action_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use crate::{
};

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub(crate) enum Modifier {
pub enum Modifier {
Lower,
Upper,
LowerFirst,
Expand Down Expand Up @@ -65,7 +65,7 @@ impl Modifier {
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub(crate) struct Set {
pub struct Set {
pub modifiers: Vec<Modifier>,
pub name: VariableType,
pub value: Value,
Expand Down
6 changes: 3 additions & 3 deletions src/compiler/grammar/actions/action_vacation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use crate::{
};

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub(crate) struct Vacation {
pub struct Vacation {
pub subject: Option<Value>,
pub from: Option<Value>,
pub mime: bool,
Expand All @@ -46,15 +46,15 @@ pub(crate) struct Vacation {
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub(crate) struct TestVacation {
pub struct TestVacation {
pub addresses: Vec<Value>,
pub period: Period,
pub handle: Option<Value>,
pub reason: Value,
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub(crate) enum Period {
pub enum Period {
Days(u64),
Seconds(u64),
Default,
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/grammar/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ use super::{
use super::tests::test_ihave::Error;

#[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)]
pub(crate) enum Instruction {
pub enum Instruction {
Require(Vec<Capability>),
Keep(Keep),
FileInto(FileInto),
Expand Down
8 changes: 4 additions & 4 deletions src/compiler/grammar/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pub enum AddressPart {
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub(crate) enum MatchType {
pub enum MatchType {
Is,
Contains,
Matches(u64),
Expand Down Expand Up @@ -134,9 +134,9 @@ pub enum Comparator {

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct Clear {
pub(crate) local_vars_idx: u32,
pub(crate) local_vars_num: u32,
pub(crate) match_vars: u64,
pub local_vars_idx: u32,
pub local_vars_num: u32,
pub match_vars: u64,
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/grammar/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ use super::{

#[allow(clippy::enum_variant_names)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub(crate) enum Test {
pub enum Test {
True,
False,
Address(TestAddress),
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/grammar/tests/test_address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use crate::compiler::{
use crate::compiler::grammar::{AddressPart, MatchType};

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub(crate) struct TestAddress {
pub struct TestAddress {
pub header_list: Vec<Value>,
pub key_list: Vec<Value>,
pub address_part: AddressPart,
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/grammar/tests/test_body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use crate::compiler::{
use crate::compiler::grammar::{test::Test, MatchType};

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub(crate) struct TestBody {
pub struct TestBody {
pub key_list: Vec<Value>,
pub body_transform: BodyTransform,
pub match_type: MatchType,
Expand All @@ -42,7 +42,7 @@ pub(crate) struct TestBody {
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub(crate) enum BodyTransform {
pub enum BodyTransform {
Raw,
Content(Vec<Value>),
Text,
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/grammar/tests/test_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use crate::compiler::{
use crate::compiler::grammar::{test::Test, MatchType};

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub(crate) struct TestHeader {
pub struct TestHeader {
pub header_list: Vec<Value>,
pub key_list: Vec<Value>,
pub match_type: MatchType,
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/grammar/tests/test_ihave.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub(crate) struct TestIhave {
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub(crate) struct Error {
pub struct Error {
pub message: Value,
}

Expand Down
2 changes: 1 addition & 1 deletion src/compiler/grammar/tests/test_spamtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use crate::compiler::grammar::{test::Test, MatchType};
*/

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub(crate) struct TestSpamTest {
pub struct TestSpamTest {
pub value: Value,
pub match_type: MatchType,
pub comparator: Comparator,
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/grammar/tests/test_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use crate::compiler::{
use crate::compiler::grammar::{test::Test, MatchType};

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub(crate) struct TestString {
pub struct TestString {
pub match_type: MatchType,
pub comparator: Comparator,
pub source: Vec<Value>,
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl Default for Compiler {
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub(crate) enum Value {
pub enum Value {
Text(Arc<String>),
Number(Number),
Variable(VariableType),
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ pub(crate) const MAX_LOCAL_VARIABLES: usize = 256;

#[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)]
pub struct Sieve {
instructions: Vec<Instruction>,
pub instructions: Vec<Instruction>,
num_vars: usize,
num_match_vars: usize,
}
Expand Down