forked from projectfluent/fluent-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
223da9f
commit 214cbb9
Showing
15 changed files
with
972 additions
and
539 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,3 +1,49 @@ | ||
//! Fluent is a modern localization system designed to improve how software is translated. | ||
//! | ||
//! `fluent-syntax` is a lowest level component of the system which exposes components | ||
//! necessary for parsing and operating on Fluent Translation Lists ("FTL"). | ||
//! | ||
//! The crate provides the `parser` module which allows for parsing of an | ||
//! input string to an Abstract Syntax Tree defined in the `ast` module. | ||
//! | ||
//! The `unicode` module exposes a set of helper functions used to decode | ||
//! escaped unicode literals according to Fluent specification. | ||
//! | ||
//! # Example | ||
//! | ||
//! ``` | ||
//! use fluent_syntax::parser; | ||
//! use fluent_syntax::ast; | ||
//! | ||
//! let ftl = r#" | ||
//! | ||
//! hello-world = Hello World! | ||
//! | ||
//! "#; | ||
//! | ||
//! let resource = parser::parse(ftl) | ||
//! .expect("Failed to parse an FTL resource."); | ||
//! | ||
//! assert_eq!( | ||
//! resource.body[0], | ||
//! ast::Entry::Message( | ||
//! ast::Message { | ||
//! id: ast::Identifier { | ||
//! name: "hello-world" | ||
//! }, | ||
//! value: Some(ast::Pattern { | ||
//! elements: vec![ | ||
//! ast::PatternElement::TextElement { | ||
//! value: "Hello World!" | ||
//! }, | ||
//! ] | ||
//! }), | ||
//! attributes: vec![], | ||
//! comment: None, | ||
//! } | ||
//! ), | ||
//! ); | ||
//! ``` | ||
pub mod ast; | ||
pub mod parser; | ||
pub mod unicode; |
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
Oops, something went wrong.