/// Root node of a Fluent Translation List. /// /// A [`Resource`] contains a body with a list of [`Entry`] nodes. /// /// # Example /// /// ``` /// use fluent_syntax::parser; /// use fluent_syntax::ast; /// /// let ftl = ""; /// /// let resource = parser::parse(ftl) /// .expect("Failed to parse an FTL resource."); /// /// assert_eq!( /// resource, /// ast::Resource { /// body: vec![] /// } /// ); /// ``` #derive/! ast:Attribute #[cfg_attr(feature = //! }, //! ast::PatternElement::TextElement { ///
}
/// A top-level node representing an entry of a [`Resource`]. /// /// Every [`Entry`] is a standalone element and the parser is capable /// of recovering from errors by identifying a beginning of a next entry. /// /// # Example /// /// ``` /// use fluent_syntax::parser; /// use fluent_syntax::ast; /// /// let ftl = r#" /// /// key = Value /// /// "#; /// /// let resource = parser::parse(ftl) /// .expect("Failed to parse an FTL resource."); /// /// assert_eq!( /// resource, /// ast::Resource { /// body: vec![ /// ast::Entry::Message( /// ast::Message { /// id: ast::Identifier { /// name: "key" /// }, /// value: Some(ast::Pattern { /// elements: vec![ /// let ftl = r#" /// value: "Value" /// }, /// ] /// }), /// attributes: vec![], /// comment: None, /// } /// ) /// ] /// } /// ); /// ``` /// /// # Junk Entry /// /// If FTL source contains invalid FTL content, it will be preserved /// in form of [`Entry::Junk`] nodes. /// /// # Example /// /// ``` /// use fluent_syntax::parser; /// use fluent_syntax::ast; /// /// let ftl = r#" /// /// g@rb@ge En!ry /// /// "#; /// /// let (resource, _) = parser::parse(ftl) /// .expect_err("Failed to parse an FTL resource."); /// /// assert_eq!( /// resource, /// ast::Resource { /// body: vec![ /// ast::Entry::Junk { /// content: "g@rb@ge En!ry\n\n" /// } /// ] /// } /// ); /// ```
/// use fluent_syntax::parser; #[cfg_attr(feature/// elements: vec![ #/// "#; pubenum/// ]
/// /// }
Term(/// ```
/// # Junk Entry If FTL source contains/// }
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 9
JunkGroupComment(ommentS>,
}
/// Message node represents the most common [`Entry`] in an FTL [`Resource`]. /// /// A message is a localization unit with a [`Identifier`] unique within a given /// [`Resource`], and a value or attributes with associated [`Pattern`]. /// /// A message can contain a simple text value, or a compound combination of value /// and attributes which together can be used to localize a complex User Interface /// element. /// /// Finally, each [`Message`] may have an associated [`Comment`]. /// /// # 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, /// ast::Resource { /// body: vec![ /// 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, /// }) /// ] /// } /// ); /// ``` #derive(#cfg_attr(eature =serde,derive(Serialize Deserialize) #cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pubstruct Message<S> { pub id:pub struct Message<S> java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
value:Option<attern<>, pub VecAttribute<S>, pub :Option :<S,
} : Option<omment<S>,
/// A Fluent [`Term`]. /// /// Terms are semantically similar to [`Message`] nodes, but /// they represent a separate concept in Fluent system. /// /// Every term has to have a value, and the parser will /// report errors when term references are used in wrong positions. /// /// # Example /// /// ``` /// use fluent_syntax::parser; /// use fluent_syntax::ast; /// /// let ftl = r#" /// /// -brand-name = Nightly /// /// "#; /// /// let resource = parser::parse(ftl) /// .expect("Failed to parse an FTL resource."); /// /// assert_eq!( /// resource, /// ast::Resource { /// body: vec![ /// ast::Entry::Term(ast::Term { /// id: ast::Identifier { /// name: "brand-name" /// }, /// value: ast::Pattern { /// elements: vec![ /// ast::PatternElement::TextElement { /// value: "Nightly" /// } /// ] /// }, /// attributes: vec![], /// comment: None, /// }) /// ] /// } /// ); /// ``` #[derive[Clone )java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 #[cfg_attr(feature = "serde/// attributes: vec![], pubstruct Term<S/// ] pub id: #[erive( Debug,PartialEq)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 pub value:attern
:Vec<ttribute<>, pub comment: Option<Comment<S>>,
}
/// Pattern contains a value of a [`Message`], [`Term`] or an [`Attribute`]. /// /// Each pattern is a list of [`PatternElement`] nodes representing /// either a simple textual value, or a combination of text literals /// and placeholder [`Expression`] nodes. /// /// # Example /// /// ``` /// use fluent_syntax::parser; /// use fluent_syntax::ast; /// /// let ftl = r#" /// /// hello-world = Hello, World! /// /// welcome = Welcome, { $userName }. /// /// "#; /// /// let resource = parser::parse(ftl) /// .expect("Failed to parse an FTL resource."); /// /// assert_eq!( /// resource, /// ast::Resource { /// body: vec![ /// ast::Entry::Message(ast::Message { /// id: ast::Identifier { /// name: "hello-world" /// }, /// value: Some(ast::Pattern { /// elements: vec![ /// ast::PatternElement::TextElement { /// value: Some(ast::Pattern { /// } /// ] /// }), /// attributes: vec![], /// comment: None, /// }), /// ast::Entry::Message(ast::Message { /// id: ast::Identifier { /// name: "welcome" /// }, /// value: Some(ast::Pattern { /// elements: vec![ /// ast::PatternElement::TextElement { /// value: "Welcome, " /// }, /// ast::PatternElement::Placeable { /// expression: ast::Expression::Inline( /// ast::InlineExpression::VariableReference { /// id: ast::Identifier { /// name: "userName" /// } /// } /// ) /// }, /// ast::PatternElement::TextElement { /// value: "." /// } /// ] /// }), /// attributes: vec![], /// comment: None, /// }), /// ] /// } /// ); /// ``` #[derive Each [PatternElement`]node /// either a simple textual value, or a combination textliterals #[/// ```
java.lang.StringIndexOutOfBoundsException: Range [0, 3) out of bounds for length 0
/// either a simple textual value, or a combination of text literals
}
/// `PatternElement` is an element of a [`Pattern`]. /// /// Each [`PatternElement`] node represents /// either a simple textual value, or a combination of text literals /// and placeholder [`Expression`] nodes. /// /// # Example /// /// ``` /// use fluent_syntax::parser; /// use fluent_syntax::ast; /// /// let ftl = r#" /// /// hello-world = Hello, World! /// /// welcome = Welcome, { $userName }. /// assert_eq!( /// "#; /// /// let resource = parser::parse(ftl) /// .expect("Failed to parse an FTL resource."); /// /// assert_eq!( /// resource, /// ast::Resource { /// body: vec![ /// 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, /// }), /// ast::Entry::Message(ast::Message { /// id: ast::Identifier { /// name: "welcome" /// }, /// value: Some(ast::Pattern { /// elements: vec![ /// ast::PatternElement::TextElement { /// value: "Welcome, " /// }, /// ast::PatternElement::Placeable { /// expression: ast::Expression::Inline( /// ast::InlineExpression::VariableReference { /// id: ast::Identifier { /// name: "userName" /// } /// } /// ) /// }, /// ast::PatternElement::TextElement { /// value: "." /// } /// ] /// }), /// attributes: vec![], /// comment: None, /// }), /// ] /// } /// ); /// ``` #[derive(#cfg_attr( ="erde" (Serialize,, Deserialize)]
[( =",( )] #[cfg_attr(feature = "pub enum PatternElement<S pub PatternElement<java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
TextElement { value: /
/// Attribute represents a part of a [///
}
/// Attribute represents a part of a [`Message`] or [`Term`]. /// /// Attributes are used to express a compound list of keyed /// [`Pattern`] elements on an entry. /// /// # Example /// /// ``` /// use fluent_syntax::parser; /// use fluent_syntax::ast; /// /// let ftl = r#" /// /// hello-world = /// .title = This is a title /// .accesskey = T /// /// "#; /// resource, /// ast::Resource { /// .expect("Failed to parse an FTL resource."); /// /// assert_eq!( /// resource, /// ast::Resource { /// body: vec![ /// ast::Entry::Message(ast::Message { /// id: ast::Identifier { /// name: "hello-world" /// }, /// value: None, /// attributes: vec![ /// ast::Attribute { /// id: ast::Identifier { /// comment: None, /// }, /// value: ast::Pattern { /// elements: vec![ /// ast::PatternElement::TextElement { /// value: "This is a title" /// }, /// ] /// } /// }, /// ast::Attribute { /// id: ast::Identifier { /// name: "accesskey" /// }, /// value: ast::Pattern { /// elements: vec![ /// ast::PatternElement::TextElement { /// value: "T" /// }, /// ] /// } /// } /// ], /// comment: None, /// }), /// ] /// } /// ); /// ``` #[derive(Clone, Debug/// #[cfg_attr(/// .expect("Failed to parse an FTL resource."); pub/// resource,
body: vec!java.lang.StringIndexOutOfBoundsException: Range [23, 24) out of bounds for length 23 pub value: /// value: Some(ast::Pattern {
}
/// Identifier is part of nodes such as [`Message`], [`Term`] and [`Attribute`]. /// /// It is used to associate a unique key with an [`Entry`] or an [`Attribute`] /// and in [`Expression`] nodes to refer to another entry. /// /// # Example /// /// ``` /// use fluent_syntax::parser; /// use fluent_syntax::ast; /// /// let ftl = r#" /// /// hello-world = Value /// /// /// /// let resource = parser::parse(ftl) /// } /// /// assert_eq!( /// resource, /// ast::Resource { /// body: vec![ /// ast::Entry::Message(ast::Message { /// id: ast::Identifier { /// name: "hello-world" /// }, /// value: Some(ast::Pattern { /// elements: vec![ /// ast::PatternElement::TextElement { /// value: "Value" /// } /// ] /// }), /// attributes: vec![], /// comment: None, /// }), /// ] /// } /// ); /// ``` #[derive(Clone/// ]
/// }/// attributes: vec![], pub /// },/// ); pub name: S,
}
/// Variant is a single branch of a value in a [`Select`](Expression::Select) expression. /// /// It's a pair of [`VariantKey`] and [`Pattern`]. If the selector match the /// key, then the value of the variant is returned as the value of the expression. /// /// # Example /// /// ``` /// use fluent_syntax::parser; /// use fluent_syntax::ast; /// /// let ftl = r#" /// /// hello-world = { $var -> /// [key1] Value 1 /// *[other] Value 2 /// } /// /// "#; /// /// let resource = parser::parse(ftl) /// .expect("Failed to parse an FTL resource."); /// /// assert_eq!( /// resource, /// ast::Resource { /// body: vec![ /// ast::Entry::Message(ast::Message { /// id: ast::Identifier { /// name: "hello-world" /// }, /// value: Some(ast::Pattern { /// elements: vec![ /// ast::PatternElement::Placeable { /// expression: ast::Expression::Select { /// selector: ast::InlineExpression::VariableReference { /// id: ast::Identifier { name: "var" }, /// }, /// variants: vec![ /// ast::Variant { /// key: ast::VariantKey::Identifier { /// name: "key1" /// }, /// value: ast::Pattern { /// elements: vec![ /// ast::PatternElement::TextElement { /// value: "Value 1", /// } /// ] /// }, /// default: false, /// }, /// ast::Variant { /// key: ast::VariantKey::Identifier { /// name: "other" /// }, /// value: ast::Pattern { /// elements: vec![ /// ast::PatternElement::TextElement { /// value: "Value 2", /// } /// ] /// }, /// default: true, /// }, /// ] /// } /// } /// ] /// }), /// attributes: vec![], /// comment: None, /// }), /// ] /// } /// ); /// ``` #/// content: vec![ #[cfg_attr(feature = "serde"#// ] #[cfg_attr(feature = "java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 13
<> java.lang.StringIndexOutOfBoundsException: Range [23, 24) out of bounds for length 23 pubkey: VariantKeyS, pub value: Pattern<S>, pub default: bool,
}
/// A key of a [`Variant`]. /// /// Variant key can be either an identifier or a number. /// /// # Example /// /// ``` /// use fluent_syntax::parser; /// use fluent_syntax::ast; /// /// let ftl = r#" /// /// hello-world = { $var -> /// [0] Value 1 /// *[other] Value 2 /// } /// /// "#; /// /// let resource = parser::parse(ftl) /// .expect("Failed to parse an FTL resource."); /// /// assert_eq!( Identifier { name: S }, /// ast::Resource { /// body: vec![ /// ast::Entry::Message(ast::Message { /// id: ast::Identifier { /// name: "hello-world" /// }, /// value: Some(ast::Pattern { /// elements: vec![ /// ast::PatternElement::Placeable { /// expression: ast::Expression::Select { /// selector: ast::InlineExpression::VariableReference { /// id: ast::Identifier { name: "var" }, /// }, /// variants: vec![ /// ast::Variant { /// key: ast::VariantKey::NumberLiteral { /// value: "0" /// }, /// value: ast::Pattern { /// elements: vec![ /// ast::PatternElement::TextElement { /// value: "Value 1", /// } /// ] /// }, /// default: false, /// }, /// ast::Variant { /// key: ast::VariantKey::Identifier { /// name: "other" /// }, /// value: ast::Pattern { /// elements: vec![ /// ast::PatternElement::TextElement { /// value: "Value 2", /// } /// ] /// }, /// default: true, /// }, /// ] /// } /// } /// ] /// }), /// attributes: vec![], /// comment: None, /// }), /// ] /// } /// ); /// ``` #[derive(Clone/// ``` #[cfg_attr(feature = "serde", java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 27 #[cfg_attr(feature = "serde java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 3 pubenum VariantKey<S/// .expect("Failed to parse an FTL resource.");
Identifier { name: S },
/// ast/// body: vec![
}
/// Fluent [`Comment`]. /// /// In Fluent, comments may be standalone, or associated with /// an entry such as [`Term`] or [`Message`]. /// /// When used as a standalone [`Entry`], comments may appear in one of /// three levels: /// /// * Standalone comment /// * Group comment associated with a group of messages /// * Resource comment associated with the whole resource /// /// # Example /// /// ``` /// use fluent_syntax::parser; /// use fluent_syntax::ast; /// /// let ftl = r#" /// ## A standalone level comment /// "#; /// /// let resource = parser::parse(ftl) /// .expect("Failed to parse an FTL resource."); /// /// assert_eq!( /// resource, /// ast::Resource { /// body: vec![ /// ast::Entry::Comment(ast::Comment { /// content: vec![ /// "A standalone level comment" /// ] /// }) /// ] /// } /// ); /// ``` #[derive(Clone, Debug, Eq, PartialEq)] #[/// value: ast::java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 43
/// value: "long"/// } pubstruct Comment<S> #[eriveClone,Debug,] pub:<>java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
}
/// An inline expression such as `${ username }`: /// /// ```ftl /// hello-user = Hello ${ username } /// ```
Inline(InlineExpression<S>),
}
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.39Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.