Struct fluent_syntax::ast::NamedArgument [−][src]
pub struct NamedArgument<S> {
pub name: Identifier<S>,
pub value: InlineExpression<S>,
}
Expand description
A key-value pair used in CallArguments
.
Example
use fluent_syntax::parser;
use fluent_syntax::ast;
let ftl = r#"
key = { FUNC(style: "long") }
"#;
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![
ast::PatternElement::Placeable {
expression: ast::Expression::Inline(
ast::InlineExpression::FunctionReference {
id: ast::Identifier {
name: "FUNC"
},
arguments: ast::CallArguments {
positional: vec![],
named: vec![
ast::NamedArgument {
name: ast::Identifier {
name: "style"
},
value: ast::InlineExpression::StringLiteral
{
value: "long"
}
}
],
}
}
)
},
]
}),
attributes: vec![],
comment: None,
}
)
]
}
);
Fields
name: Identifier<S>
value: InlineExpression<S>
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl<S> RefUnwindSafe for NamedArgument<S> where
S: RefUnwindSafe,
impl<S> Send for NamedArgument<S> where
S: Send,
impl<S> Sync for NamedArgument<S> where
S: Sync,
impl<S> Unpin for NamedArgument<S> where
S: Unpin,
impl<S> UnwindSafe for NamedArgument<S> where
S: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more