From 665b4d2aca81af48b8e0eaca4e709ef2e7825844 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Fri, 13 Dec 2019 23:59:01 +0100 Subject: =?UTF-8?q?More=20consistent=20library=20code=20and=20functions=20?= =?UTF-8?q?=F0=9F=8E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/func/macros.rs | 15 +++++++++------ src/func/mod.rs | 1 + 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'src/func') diff --git a/src/func/macros.rs b/src/func/macros.rs index 17a554cf..df795213 100644 --- a/src/func/macros.rs +++ b/src/func/macros.rs @@ -5,22 +5,25 @@ macro_rules! function { // Parse a unit struct. ($(#[$outer:meta])* pub struct $type:ident; $($rest:tt)*) => { - $(#[$outer])* - pub struct $type; + $(#[$outer])* pub struct $type; function!(@meta $type | $($rest)*); }; // Parse a tuple struct. ($(#[$outer:meta])* pub struct $type:ident($($fields:tt)*); $($rest:tt)*) => { - $(#[$outer])* - pub struct $type($($fields)*); + $(#[$outer])* pub struct $type($($fields)*); function!(@meta $type | $($rest)*); }; // Parse a struct with fields. ($(#[$outer:meta])* pub struct $type:ident { $($fields:tt)* } $($rest:tt)*) => { - $(#[$outer])* - pub struct $type { $($fields)* } + $(#[$outer])* pub struct $type { $($fields)* } + function!(@meta $type | $($rest)*); + }; + + // Parse an enum. + ($(#[$outer:meta])* pub enum $type:ident { $($fields:tt)* } $($rest:tt)*) => { + $(#[$outer])* pub enum $type { $($fields)* } function!(@meta $type | $($rest)*); }; diff --git a/src/func/mod.rs b/src/func/mod.rs index a5328314..babde1ae 100644 --- a/src/func/mod.rs +++ b/src/func/mod.rs @@ -107,6 +107,7 @@ pub enum Command<'a> { FinishRun, FinishSpace, BreakParagraph, + BreakPage, SetTextStyle(TextStyle), SetPageStyle(PageStyle), -- cgit v1.2.3