mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Derive HasViewportPercentage 🍷
This commit is contained in:
parent
d1e31f7aa4
commit
90bae7f802
27 changed files with 202 additions and 452 deletions
18
components/style_derive/lib.rs
Normal file
18
components/style_derive/lib.rs
Normal file
|
@ -0,0 +1,18 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
extern crate proc_macro;
|
||||
#[macro_use] extern crate quote;
|
||||
extern crate syn;
|
||||
extern crate synstructure;
|
||||
|
||||
use proc_macro::TokenStream;
|
||||
|
||||
mod has_viewport_percentage;
|
||||
|
||||
#[proc_macro_derive(HasViewportPercentage)]
|
||||
pub fn derive_has_viewport_percentage(stream: TokenStream) -> TokenStream {
|
||||
let input = syn::parse_derive_input(&stream.to_string()).unwrap();
|
||||
has_viewport_percentage::derive(input).to_string().parse().unwrap()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue