grammar refactoring: part of build_visitor fixed

This commit is contained in:
ProgramSnail 2023-04-09 18:49:52 +03:00
parent 2d2bb9ec65
commit 64653e6a6a
6 changed files with 245 additions and 404 deletions

View file

@ -215,7 +215,9 @@ using TypeSubExpression = std::variant<
// Comments [IGNORE] -----------------
// Identifiers, constants, etc. -----------------
using ExtendedName = std::string;
struct ExtendedName {
std::string name;
};
struct FloatNumberLiteral;
struct NumberLiteral;
@ -255,7 +257,8 @@ struct Sources {
// ----------------- Namespaces, partittions -----------------
struct Namespace {
enum { Const, Var } modifier;
enum Modifier { Const, Var };
std::optional<Modifier> modifier;
std::optional<ExtendedName> name;
TypeIdentifier type;
std::unique_ptr<Sources> scope;
@ -315,7 +318,7 @@ struct TypeDefinitionStatement {
struct AbstractTypeDefinitionStatement {
enum { Basic, Abstract } modifier;
std::unique_ptr<AnnotatedType> definition;
std::unique_ptr<AnnotatedType> type;
};
struct TypeclassDefinitionStatement {