diff options
| author | Laurenz <laurmaedje@gmail.com> | 2019-10-23 00:14:43 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2019-10-23 00:21:40 +0200 |
| commit | ecf0ff4d054f11c79ec0ddbbdf45f3dfcf9fc8d7 (patch) | |
| tree | efdc76915e5c7f43629aa3aa5d5aa3998d7f5367 /src/library/breaks.rs | |
| parent | cff325b520727ac0eec46a3757831afaa0916cc1 (diff) | |
Introduce a set of macros for writing functions more concisely 🎁
Diffstat (limited to 'src/library/breaks.rs')
| -rw-r--r-- | src/library/breaks.rs | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/src/library/breaks.rs b/src/library/breaks.rs deleted file mode 100644 index a622350f..00000000 --- a/src/library/breaks.rs +++ /dev/null @@ -1,47 +0,0 @@ -use super::prelude::*; - -/// Ends the current line. -#[derive(Debug, PartialEq)] -pub struct LinebreakFunc; - -impl Function for LinebreakFunc { - fn parse(header: &FuncHeader, body: Option<&str>, _: ParseContext) -> ParseResult<Self> - where Self: Sized { - if has_arguments(header) { - return err("linebreak: expected no arguments"); - } - - if body.is_some() { - return err("linebreak: expected no body"); - } - - Ok(LinebreakFunc) - } - - fn layout(&self, _: LayoutContext) -> LayoutResult<CommandList> { - Ok(commands![Command::FinishFlexRun]) - } -} - -/// Ends the current page. -#[derive(Debug, PartialEq)] -pub struct PagebreakFunc; - -impl Function for PagebreakFunc { - fn parse(header: &FuncHeader, body: Option<&str>, _: ParseContext) -> ParseResult<Self> - where Self: Sized { - if has_arguments(header) { - return err("pagebreak: expected no arguments"); - } - - if body.is_some() { - return err("pagebreak: expected no body"); - } - - Ok(PagebreakFunc) - } - - fn layout(&self, _: LayoutContext) -> LayoutResult<CommandList> { - Ok(commands![Command::FinishLayout]) - } -} |
