diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-07-29 17:46:57 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-29 17:46:57 +0200 |
| commit | f34ba3dcda182d9b9c14cc94fdb48810bf18bef0 (patch) | |
| tree | 667a7aba2f26996c7ada8ce85952c384a1dbd5a1 /src/syntax/func | |
| parent | e7ffdde43d09f60238590723c2829554806e23d5 (diff) | |
| parent | 9672d4320052d08b67d497febed4a0ad78bf9252 (diff) | |
Merge pull request #7 from typst/parser-update
Parser update
Diffstat (limited to 'src/syntax/func')
| -rw-r--r-- | src/syntax/func/mod.rs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/syntax/func/mod.rs b/src/syntax/func/mod.rs index d379b407..4228488d 100644 --- a/src/syntax/func/mod.rs +++ b/src/syntax/func/mod.rs @@ -9,22 +9,23 @@ pub_use_mod!(maps); pub_use_mod!(keys); pub_use_mod!(values); +/// An invocation of a function. +#[derive(Debug, Clone, PartialEq)] +pub struct FuncCall<'s> { + pub header: FuncHeader, + /// The body as a raw string containing what's inside of the brackets. + pub body: Option<Spanned<&'s str>>, +} -/// The parsed header of a function. +/// The parsed header of a function (everything in the first set of brackets). #[derive(Debug, Clone, PartialEq)] pub struct FuncHeader { - /// The function name, that is: - /// ```typst - /// [box: w=5cm] - /// ^^^ - /// ``` pub name: Spanned<Ident>, - /// The arguments passed to the function. pub args: FuncArgs, } /// The positional and keyword arguments passed to a function. -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Default, Clone, PartialEq)] pub struct FuncArgs { /// The positional arguments. pub pos: Tuple, |
