From ecf0ff4d054f11c79ec0ddbbdf45f3dfcf9fc8d7 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 23 Oct 2019 00:14:43 +0200 Subject: =?UTF-8?q?Introduce=20a=20set=20of=20macros=20for=20writing=20fun?= =?UTF-8?q?ctions=20more=20concisely=20=F0=9F=8E=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/library/breaks.rs | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 src/library/breaks.rs (limited to 'src/library/breaks.rs') 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 - 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 { - 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 - 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 { - Ok(commands![Command::FinishLayout]) - } -} -- cgit v1.2.3