mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Remove raw_longhand helper function
This commit is contained in:
parent
b24614f894
commit
ce46e6d034
1 changed files with 10 additions and 18 deletions
|
@ -4,23 +4,6 @@
|
|||
|
||||
<%! from data import Keyword, to_rust_ident, to_camel_case, LOGICAL_SIDES, PHYSICAL_SIDES, LOGICAL_SIZES %>
|
||||
|
||||
<%def name="longhand(name, **kwargs)">
|
||||
<%call expr="raw_longhand(name, **kwargs)">
|
||||
${caller.body()}
|
||||
% if not data.longhands_by_name[name].derived_from:
|
||||
pub fn parse_specified(context: &ParserContext, input: &mut Parser)
|
||||
% if data.longhands_by_name[name].boxed:
|
||||
-> Result<DeclaredValue<Box<SpecifiedValue>>, ()> {
|
||||
parse(context, input).map(|result| DeclaredValue::Value(Box::new(result)))
|
||||
% else:
|
||||
-> Result<DeclaredValue<SpecifiedValue>, ()> {
|
||||
parse(context, input).map(DeclaredValue::Value)
|
||||
% endif
|
||||
}
|
||||
% endif
|
||||
</%call>
|
||||
</%def>
|
||||
|
||||
<%def name="predefined_type(name, type, initial_value, parse_method='parse',
|
||||
needs_context=True, vector=False, **kwargs)">
|
||||
<%def name="predefined_type_inner(name, type, initial_value, parse_method)">
|
||||
|
@ -212,7 +195,7 @@
|
|||
</%call>
|
||||
</%def>
|
||||
|
||||
<%def name="raw_longhand(*args, **kwargs)">
|
||||
<%def name="longhand(*args, **kwargs)">
|
||||
<%
|
||||
property = data.declare_longhand(*args, **kwargs)
|
||||
if property is None:
|
||||
|
@ -322,6 +305,15 @@
|
|||
% endif
|
||||
}
|
||||
% if not property.derived_from:
|
||||
pub fn parse_specified(context: &ParserContext, input: &mut Parser)
|
||||
% if property.boxed:
|
||||
-> Result<DeclaredValue<Box<SpecifiedValue>>, ()> {
|
||||
parse(context, input).map(|result| DeclaredValue::Value(Box::new(result)))
|
||||
% else:
|
||||
-> Result<DeclaredValue<SpecifiedValue>, ()> {
|
||||
parse(context, input).map(DeclaredValue::Value)
|
||||
% endif
|
||||
}
|
||||
pub fn parse_declared(context: &ParserContext, input: &mut Parser)
|
||||
% if property.boxed:
|
||||
-> Result<DeclaredValue<Box<SpecifiedValue>>, ()> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue