diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-01-10 13:03:43 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-01-10 13:03:43 +0100 |
| commit | a75ddd2c9356da85b155f5c52fd064c15e6f81b3 (patch) | |
| tree | 40d63a65d84945bd2cbf33449096e14e84babdf9 /src/func | |
| parent | 5dbc7dc5aaaea794b140c5ea7839d681110d7b79 (diff) | |
Convert spans to line/column format 📑
Diffstat (limited to 'src/func')
| -rw-r--r-- | src/func/macros.rs | 6 | ||||
| -rw-r--r-- | src/func/mod.rs | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/func/macros.rs b/src/func/macros.rs index bbe04b98..3a32ec09 100644 --- a/src/func/macros.rs +++ b/src/func/macros.rs @@ -80,7 +80,7 @@ macro_rules! function { fn parse( args: FuncArgs, - $body: Option<Spanned<&str>>, + $body: Option<&str>, $ctx: ParseContext, $metadata: Self::Meta, ) -> ParseResult<Self> where Self: Sized { @@ -144,7 +144,7 @@ macro_rules! parse { (optional: $body:expr, $ctx:expr) => ( if let Some(body) = $body { - Some($crate::syntax::parse(body.v, $ctx)?) + Some($crate::syntax::parse(body, $ctx)?) } else { None } @@ -152,7 +152,7 @@ macro_rules! parse { (expected: $body:expr, $ctx:expr) => ( if let Some(body) = $body { - $crate::syntax::parse(body.v, $ctx)? + $crate::syntax::parse(body, $ctx)? } else { error!("expected body"); } diff --git a/src/func/mod.rs b/src/func/mod.rs index aca612aa..69f28e00 100644 --- a/src/func/mod.rs +++ b/src/func/mod.rs @@ -32,7 +32,7 @@ pub trait ParseFunc { /// Parse the header and body into this function given a context. fn parse( args: FuncArgs, - body: Option<Spanned<&str>>, + body: Option<&str>, ctx: ParseContext, metadata: Self::Meta, ) -> ParseResult<Self> where Self: Sized; @@ -125,7 +125,7 @@ pub struct Scope { /// implements [`LayoutFunc`]. type Parser = dyn Fn( FuncArgs, - Option<Spanned<&str>>, + Option<&str>, ParseContext ) -> ParseResult<Box<dyn LayoutFunc>>; |
