summaryrefslogtreecommitdiff
path: root/src/stages/semantic.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/stages/semantic.rs')
-rw-r--r--src/stages/semantic.rs17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/stages/semantic.rs b/src/stages/semantic.rs
index eb9e7b6..b72cfa8 100644
--- a/src/stages/semantic.rs
+++ b/src/stages/semantic.rs
@@ -431,11 +431,13 @@ impl SemanticParser {
let token = self.syntactic.pop()?;
let source = token.source;
match token.value {
+ // Integer-type argument.
SyntacticToken::Symbol(ScopedSymbol::Global(name)) => {
let variant = ArgumentType::Integer;
let definition = ArgumentDefinition { name, variant };
return Some(Tracked::from(definition, source));
}
+ // Block-type argument.
SyntacticToken::BlockLiteral(mut tokens) => {
if tokens.len() == 1 {
let token = tokens.pop().unwrap();
@@ -446,11 +448,16 @@ impl SemanticParser {
}
}
}
- SyntacticToken::StringLiteral(string) => {
- let variant = ArgumentType::String;
- let name = string.string;
- let definition = ArgumentDefinition { name, variant };
- return Some(Tracked::from(definition, source));
+ // List-type argument.
+ SyntacticToken::Expression(mut tokens) => {
+ if tokens.len() == 1 {
+ let token = tokens.pop().unwrap();
+ if let SyntacticToken::Symbol(ScopedSymbol::Global(name)) = token.value {
+ let variant = ArgumentType::List;
+ let definition = ArgumentDefinition { name, variant };
+ return Some(Tracked::from(definition, source));
+ }
+ }
}
_ => (),
};