-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extensively document and clean up css_lexer/css_parse (#78)
Yet another giant refactor: - Removed `hdx_atom` crate, instead opting to do interning on each node. This de-couples the lexer & parser from _css_ the language itself. - Fold in `hdx_syntax` into `hdx_lexer` as it wasn't used outside of that. - Rename `hdx_lexer` to `css_lexer`. - Rename `hdx_parser` to `css_parse`. - Extensively document `css_lexer` & `css_parse`. - Fold in a bunch of the macros in `hdx_ast` into `css_parse`. - Rename `hdx_ast` to `css_ast` - make it just for CSS (the original intent was for `hdx_ast` to have multiple language ASTs, e.g. `sass`, but I think now we can add a `sass_ast` crate instead).
- Loading branch information
Showing
652 changed files
with
1,667,472 additions
and
1,600,639 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
mod properties; | ||
mod rules; | ||
mod selector; | ||
mod specificity; | ||
mod stylerule; | ||
mod stylesheet; | ||
mod traits; | ||
mod types; | ||
mod units; | ||
mod values; | ||
mod visit; | ||
|
||
pub use properties::*; | ||
pub use rules::*; | ||
pub use selector::*; | ||
pub use stylerule::*; | ||
pub use stylesheet::*; | ||
pub use types::*; | ||
pub use units::*; | ||
pub use values::*; | ||
pub use visit::*; | ||
|
||
use css_lexer::Span; | ||
use css_parse::{diagnostics, CursorSink, Parse, Parser, Result as ParserResult, ToCursors}; | ||
|
||
// TODO! - delete this when we're done ;) | ||
#[derive(Default, Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] | ||
#[cfg_attr(feature = "serde", derive(serde::Serialize), serde(untagged))] | ||
pub enum Todo { | ||
#[default] | ||
Todo, | ||
} | ||
|
||
impl<'a> Parse<'a> for Todo { | ||
fn parse(p: &mut Parser<'a>) -> ParserResult<Self> { | ||
Err(diagnostics::Unimplemented(Span::new(p.offset(), p.offset())))? | ||
} | ||
} | ||
|
||
impl ToCursors for Todo { | ||
fn to_cursors(&self, _: &mut impl CursorSink) {} | ||
} | ||
|
||
impl<'a> Visitable<'a> for Todo { | ||
fn accept<V: Visit<'a>>(&self, _: &mut V) {} | ||
} |
Oops, something went wrong.