diff options
| author | Martin Haug <mhaug@live.de> | 2022-05-27 16:39:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-27 16:39:06 +0200 |
| commit | 73086b5a7c1b0f9f638165803c237901499adb64 (patch) | |
| tree | c120a2449aaf325cb675ea3363ee69758a734d86 /src/eval/args.rs | |
| parent | 99cb655832161d4ebec73273a15453a8f6acc1b7 (diff) | |
| parent | 8ba11b0722599892499337b3272cec38945d11de (diff) | |
Merge pull request #71 from typst/pins
Diffstat (limited to 'src/eval/args.rs')
| -rw-r--r-- | src/eval/args.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/eval/args.rs b/src/eval/args.rs index 69e6aaee..4d280ff7 100644 --- a/src/eval/args.rs +++ b/src/eval/args.rs @@ -39,6 +39,15 @@ impl Args { Self { span, items } } + /// Push a positional argument. + pub fn push(&mut self, span: Span, value: Value) { + self.items.push(Arg { + span: self.span, + name: None, + value: Spanned::new(value, span), + }) + } + /// Consume and cast the first positional argument if there is one. pub fn eat<T>(&mut self) -> TypResult<Option<T>> where |
