Skip to content

Commit

Permalink
chore(crate): add pub engine
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mendez committed Oct 15, 2023
1 parent 70d2a20 commit 12803d7
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion accessibility-rs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "accessibility-rs"
version = "0.0.26"
version = "0.0.27"
authors = ["The A11yWatch Project Developers", "Jeff Mendez <[email protected]>"]
edition = "2021"
license = "MIT OR Apache-2.0"
Expand Down
1 change: 1 addition & 0 deletions accessibility-rs/src/engine/rules/utils/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/// utilities for node extracting
pub mod nodes;
2 changes: 2 additions & 0 deletions accessibility-rs/src/engine/styles/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ use selectors::parser::SelectorParseErrorKind;
// UnknownUnit(CowRcStr<'i>),
// }

/// rule parsing errors
pub enum RuleParseErrorKind<'i> {
/// selector parse error
Selector(SelectorParseErrorKind<'i>),
}

Expand Down
8 changes: 7 additions & 1 deletion accessibility-rs/src/engine/styles/rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,30 @@ use cssparser::{AtRuleParser, ParseError, QualifiedRuleParser};
use std::sync::Arc;

#[derive(Debug)]
/// Css rules to match selectors
pub enum CssRule {
/// the style rules for css
StyleRule {
/// css selectors list with selector trait
selectors: selectors::SelectorList<Simple>,
/// a css block parsed
block: Arc<String>,
},
}

/// css parser
pub struct Parser;

impl<'i> selectors::parser::Parser<'i> for Parser {
type Impl = Simple;
type Error = RuleParseErrorKind<'i>;
}

/// css selector list
pub type SelectorList = selectors::SelectorList<Simple>;
// pub type Selector = selectors::parser::Selector<Simple>;

/// css rules parser
pub struct RulesParser;

impl<'i> QualifiedRuleParser<'i> for RulesParser {
Expand Down Expand Up @@ -51,7 +58,6 @@ impl<'i> QualifiedRuleParser<'i> for RulesParser {
impl<'i> AtRuleParser<'i> for RulesParser {
type PreludeBlock = ();
type PreludeNoBlock = ();

type AtRule = CssRule;
type Error = RuleParseErrorKind<'i>;
}
1 change: 1 addition & 0 deletions accessibility-rs/src/i18n/locales.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pub struct Messages {
hi: M,
}

/// the languages for auditing results
pub enum Langs {
/// english
En,
Expand Down
6 changes: 3 additions & 3 deletions accessibility-rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ extern crate lazy_static;
#[macro_use]
extern crate rust_i18n;

/// the main engine for audits.
mod engine;
/// the main engine for accessibility auditing.
pub mod engine;
/// locales for translations.
mod i18n;
pub mod i18n;

use crate::engine::audit::auditor::Auditor;
use crate::engine::issue::Issue;
Expand Down

0 comments on commit 12803d7

Please sign in to comment.