From c8490bfe36b6857f605fedf539f9c913af1fb7a1 Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Fri, 4 Jun 2021 14:52:22 +0200 Subject: [PATCH] WIP --- source/tlang/compiler/parsing/core.d | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/source/tlang/compiler/parsing/core.d b/source/tlang/compiler/parsing/core.d index 68c63ec..ac52727 100644 --- a/source/tlang/compiler/parsing/core.d +++ b/source/tlang/compiler/parsing/core.d @@ -526,6 +526,26 @@ public final class Parser } } + private InitScope getInitScope(Token token) + { + if(getSymbolType(token) == SymbolType.STATIC) + { + return InitScope.STATIC; + } + else if(getSymbolType(token) == SymbolType.PROTECTED) + { + return AccessorType.PROTECTED; + } + else if(getSymbolType(token) == SymbolType.PRIVATE) + { + return AccessorType.PRIVATE; + } + else + { + return InitScope.UNKNOWN; + } + } + /* STATUS: Not being used yet */ /** @@ -536,8 +556,8 @@ public final class Parser { Entity entity; - /* Save and consume the accessor */ - AccessorType accessorType = getAccessorType(getCurrentToken()); + /* Save and consume the init-scope */ + InitScope initScope = getInitScope(getCurrentToken()); nextToken(); /* TODO: Implement me and fix the above */