aboutsummaryrefslogtreecommitdiff
path: root/src/Language
diff options
context:
space:
mode:
authorEinhard Leichtfuß <alguien@respiranto.de>2025-05-20 23:23:11 +0200
committerEinhard Leichtfuß <alguien@respiranto.de>2025-05-20 23:23:11 +0200
commita4b8e1f1ee54ac6ff92adf1c0ed166f478c48258 (patch)
tree04078405c3fe21359a52052b29023273913ea499 /src/Language
parentea3ba17104307fa1081ebe5ce7a815d9ef01fa11 (diff)
Add `=` token to function definition
Diffstat (limited to 'src/Language')
-rw-r--r--src/Language/SimpleShell/Parser/Function.hs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/Language/SimpleShell/Parser/Function.hs b/src/Language/SimpleShell/Parser/Function.hs
index 26f5a5c..a0c5a9b 100644
--- a/src/Language/SimpleShell/Parser/Function.hs
+++ b/src/Language/SimpleShell/Parser/Function.hs
@@ -25,6 +25,7 @@ functionP = do
t' <- simpleTypeP
fname <- nameP
params <- symbol "(" *> paramP `sepBy` symbol "," <* symbol ")"
+ symbol "="
let (ts, vars) = unzip params
body <- forceType t' (bodyP params) <|> fail "Function return type mismatch."
return ((t', ts), Function fname vars body)