summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
authorkdx <kdx@42l.fr>2023-03-17 03:49:29 +0100
committerkdx <kdx@42l.fr>2023-03-17 03:49:29 +0100
commit1aa823effc534526c1bc2ec4ca80139826660f2f (patch)
tree8739530a2a8ec0df738cbdd72277b85bbfce2715 /scope.c
parent4160e9650bcfe7449beb150cdf8196b768a92eb3 (diff)
downloadgolem-1aa823effc534526c1bc2ec4ca80139826660f2f.tar.gz
scope function arguments
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/scope.c b/scope.c
index 722e430..fdd36c5 100644
--- a/scope.c
+++ b/scope.c
@@ -25,3 +25,23 @@ scope_extract(Token *list)
} else
e = e->next;
}
+
+static void
+_scope_function(Token *list)
+{
+ unsigned int len = token_len(list->group.tokens);
+ while (len > 2) {
+ token_append(&list->group.scope,
+ token_extract(&list->group.tokens,
+ list->group.tokens->next));
+ len -= 1;
+ }
+}
+
+void
+scope_function(Token *list)
+{
+ for (Token *e = list->group.tokens; e != NULL; e = e->next)
+ if (token_isgroup(e, GROUP_FUNCTION))
+ _scope_function(e);
+}