diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-05-26 13:49:44 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-05-26 13:49:44 +0200 |
| commit | a9869c212f7c1bc77a52e301ad014641b014e834 (patch) | |
| tree | 97b5d6c71940e903482ba2f30cbcedd8f1c17ea3 /src/eval/args.rs | |
| parent | 66d8f4569a9f13270c5f477e0730f127a22333e2 (diff) | |
Locatable groups
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 |
