From 9871cc66c797a284241ed18d3643c84506b66d7b Mon Sep 17 00:00:00 2001 From: Username404 Date: Sun, 8 Aug 2021 22:53:29 +0200 Subject: [PATCH] Add a Reference structure to the StandardComponents namespace. --- src/headers/parsing/ParseComponents.hpp | 3 +++ src/headers/parsing/Parser.hpp | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/headers/parsing/ParseComponents.hpp b/src/headers/parsing/ParseComponents.hpp index f755603..f6edd22 100644 --- a/src/headers/parsing/ParseComponents.hpp +++ b/src/headers/parsing/ParseComponents.hpp @@ -31,6 +31,9 @@ namespace StandardComponents { explicit Define(const bool& isFinal, string_view nameText): NamedIdentifier(nameText), final(isFinal) {} explicit Define(string_view nameText): Define(false, nameText) {} }; + struct Reference: NamedIdentifier { + using NamedIdentifier::NamedIdentifier; + }; struct Class: NamedIdentifier { struct Constructor {}; diff --git a/src/headers/parsing/Parser.hpp b/src/headers/parsing/Parser.hpp index b30109b..532f86b 100644 --- a/src/headers/parsing/Parser.hpp +++ b/src/headers/parsing/Parser.hpp @@ -28,6 +28,8 @@ namespace Parser { if (isFinalDefine || next.toktype == tok::DEFINE) { parseTree << Define(isFinalDefine, current.toktext); i += isFinalDefine ? 2 : 1; + } else { + parseTree << Reference(current.toktext); } } }