Skip to content

Commit

Permalink
Split up parser into separate files
Browse files Browse the repository at this point in the history
  • Loading branch information
praveenperera committed Jan 31, 2025
1 parent aa24856 commit fd48f2d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 3 additions & 4 deletions rustywind-core/src/parser.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
//! Create a sorter from a CSS file to sort classes in the order that they appear in the file
pub mod regex;

use std::{
collections::hash_map::Entry,
fs::File,
io::{BufRead, BufReader, Read},
};

use eyre::Result;
use once_cell::sync::Lazy;
use regex::Regex;

use ahash::AHashMap as HashMap;

static PARSER_RE: Lazy<Regex> = Lazy::new(|| Regex::new(r"^(\.[^\s]+)[ ]").unwrap());
use regex::PARSER_RE;

/// Create the sorter from a [File]
pub fn parse_classes_from_file(css_file: File) -> Result<HashMap<String, usize>> {
Expand Down
Empty file.
4 changes: 4 additions & 0 deletions rustywind-core/src/parser/regex.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
use once_cell::sync::Lazy;
use regex::Regex;

pub(crate) static PARSER_RE: Lazy<Regex> = Lazy::new(|| Regex::new(r"^(\.[^\s]+)[ ]").unwrap());

0 comments on commit fd48f2d

Please sign in to comment.