Skip to content

Commit

Permalink
feat: start working on yaml support (#2428)
Browse files Browse the repository at this point in the history
Co-authored-by: Emanuele Stoppa <[email protected]>
Co-authored-by: Maikel <[email protected]>
  • Loading branch information
3 people authored Apr 17, 2024
1 parent 838ccb4 commit c9a9001
Show file tree
Hide file tree
Showing 27 changed files with 1,729 additions and 13 deletions.
36 changes: 36 additions & 0 deletions Cargo.lock

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

23 changes: 14 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,20 @@ biome_json_factory = { version = "0.5.7", path = "./crates/biome_json_
biome_json_formatter = { version = "0.5.7", path = "./crates/biome_json_formatter" }
biome_json_parser = { version = "0.5.7", path = "./crates/biome_json_parser" }
biome_json_syntax = { version = "0.5.7", path = "./crates/biome_json_syntax" }
biome_markup = { version = "0.5.7", path = "./crates/biome_markup" }
biome_parser = { version = "0.5.7", path = "./crates/biome_parser" }
biome_project = { version = "0.5.7", path = "./crates/biome_project" }
biome_rowan = { version = "0.5.7", path = "./crates/biome_rowan" }
biome_string_case = { version = "0.5.7", path = "./crates/biome_string_case" }
biome_suppression = { version = "0.5.7", path = "./crates/biome_suppression" }
biome_text_edit = { version = "0.5.7", path = "./crates/biome_text_edit" }
biome_text_size = { version = "0.5.7", path = "./crates/biome_text_size" }
biome_unicode_table = { version = "0.5.7", path = "./crates/biome_unicode_table" }
biome_yaml_factory = { version = "0.0.1", path = "./crates/biome_yaml_factory" }
biome_yaml_parser = { version = "0.0.1", path = "./crates/biome_yaml_parser" }
biome_yaml_syntax = { version = "0.0.1", path = "./crates/biome_yaml_syntax" }

biome_markup = { version = "0.5.7", path = "./crates/biome_markup" }
biome_parser = { version = "0.5.7", path = "./crates/biome_parser" }
biome_project = { version = "0.5.7", path = "./crates/biome_project" }
biome_rowan = { version = "0.5.7", path = "./crates/biome_rowan" }
biome_string_case = { version = "0.5.7", path = "./crates/biome_string_case" }
biome_suppression = { version = "0.5.7", path = "./crates/biome_suppression" }
biome_text_edit = { version = "0.5.7", path = "./crates/biome_text_edit" }
biome_text_size = { version = "0.5.7", path = "./crates/biome_text_size" }
biome_unicode_table = { version = "0.5.7", path = "./crates/biome_unicode_table" }

# not publish
biome_cli = { path = "./crates/biome_cli" }
biome_configuration = { path = "./crates/biome_configuration" }
Expand Down
20 changes: 20 additions & 0 deletions crates/biome_yaml_factory/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[package]
authors.workspace = true
categories.workspace = true
description = "Utilities to create YAML AST for biome_yaml_parser"
edition.workspace = true
homepage.workspace = true
keywords.workspace = true
license.workspace = true
name = "biome_yaml_factory"
repository.workspace = true
version = "0.0.1"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
biome_rowan = { workspace = true }
biome_yaml_syntax = { workspace = true }

[lints]
workspace = true
6 changes: 6 additions & 0 deletions crates/biome_yaml_factory/src/generated.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#[rustfmt::skip]
pub(super) mod syntax_factory;
#[rustfmt::skip]
pub mod node_factory;

pub use syntax_factory::YamlSyntaxFactory;
96 changes: 96 additions & 0 deletions crates/biome_yaml_factory/src/generated/node_factory.rs

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

119 changes: 119 additions & 0 deletions crates/biome_yaml_factory/src/generated/syntax_factory.rs

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

12 changes: 12 additions & 0 deletions crates/biome_yaml_factory/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use biome_rowan::TreeBuilder;
use biome_yaml_syntax::YamlLanguage;

mod generated;
pub mod make;
pub use crate::generated::YamlSyntaxFactory;

// Re-exported for tests
#[doc(hidden)]
pub use biome_yaml_syntax as syntax;

pub type YamlSyntaxTreeBuilder = TreeBuilder<'static, YamlLanguage, YamlSyntaxFactory>;
1 change: 1 addition & 0 deletions crates/biome_yaml_factory/src/make.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub use crate::generated::node_factory::*;
32 changes: 32 additions & 0 deletions crates/biome_yaml_parser/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[package]
authors.workspace = true
categories.workspace = true
description = "Biome's YAML parser"
edition.workspace = true
homepage.workspace = true
keywords.workspace = true
license.workspace = true
name = "biome_yaml_parser"
repository.workspace = true
version = "0.0.1"

[lints]
workspace = true

[dependencies]
biome_console = { workspace = true }
biome_diagnostics = { workspace = true }
biome_parser = { workspace = true }
biome_rowan = { workspace = true }
biome_unicode_table = { workspace = true }
biome_yaml_factory = { workspace = true }
biome_yaml_syntax = { workspace = true }
tracing = { workspace = true }


[dev-dependencies]
biome_test_utils = { path = "../biome_test_utils" }
insta = { workspace = true }
quickcheck = { workspace = true }
quickcheck_macros = { workspace = true }
tests_macros = { path = "../tests_macros" }
19 changes: 19 additions & 0 deletions crates/biome_yaml_parser/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<p align="center">
<img alt="Biome - Toolchain of the web" width="400" src="https://raw.githubusercontent.com/biomejs/resources/main/svg/slogan-light-transparent.svg"/>
</p>

<div align="center">

[![Discord chat][discord-badge]][discord-url]
[![cargo version][cargo-badge]][cargo-url]

[discord-badge]: https://badgen.net/discord/online-members/BypW39g6Yc?icon=discord&label=discord&color=green
[discord-url]: https://discord.gg/BypW39g6Yc
[cargo-badge]: https://badgen.net/crates/v/biome_yaml_parser?&color=green
[cargo-url]: https://crates.io/crates/biome_yaml_parser/

</div>

# `biome_yaml_parser`

Biome's YAML parser implementation. Follow the [documentation](https://docs.rs/biome_yaml_parser/).
Loading

0 comments on commit c9a9001

Please sign in to comment.