summaryrefslogtreecommitdiff
path: root/src/func
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2019-12-13 23:59:01 +0100
committerLaurenz <laurmaedje@gmail.com>2019-12-13 23:59:01 +0100
commit665b4d2aca81af48b8e0eaca4e709ef2e7825844 (patch)
tree4ada33f607455f14b6a170fe4b7fbe173056567b /src/func
parent971ff3a2dcff1e68bf7e19017113469aad5a30c2 (diff)
More consistent library code and functions 🎄
Diffstat (limited to 'src/func')
-rw-r--r--src/func/macros.rs15
-rw-r--r--src/func/mod.rs1
2 files changed, 10 insertions, 6 deletions
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),