mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2025-12-06 06:58:45 +00:00
build_visitor first iteration
This commit is contained in:
parent
622b86f6c6
commit
582ad5668e
5 changed files with 338 additions and 116 deletions
|
|
@ -131,7 +131,7 @@ private:
|
|||
|
||||
// Identifiers, constants, etc. -----------------
|
||||
|
||||
// // void Visit(AnyIdentifier* node) override; // std::string
|
||||
void Visit(AnyIdentifier* node) override; // std::string
|
||||
|
||||
void Visit(FloatNumberLiteral* node) override;
|
||||
void Visit(NumberLiteral* node) override;
|
||||
|
|
|
|||
|
|
@ -480,7 +480,7 @@ struct LambdaFunction : public Node {
|
|||
|
||||
struct NameSuperExpression : public Node {
|
||||
std::vector<TypeSubExpression> namespaces;
|
||||
std::vector<NameSubSuperExpression> expressions; // last is not SuperExpression
|
||||
std::vector<NameSubSuperExpression> expressions;
|
||||
};
|
||||
|
||||
struct NameExpression : public Node {
|
||||
|
|
@ -511,13 +511,13 @@ struct TypeConstructor : public Node {
|
|||
};
|
||||
|
||||
struct TupleType : public Node {
|
||||
TypeIdentifierDefinition type; // optional
|
||||
std::vector<std::pair<NameIdentifier, AnyType>> entities; // NameIdentifier is optional
|
||||
std::optional<TypeIdentifierDefinition> type;
|
||||
std::vector<std::pair<std::optional<NameIdentifier>, AnyType>> entities;
|
||||
};
|
||||
|
||||
struct VariantType : public Node {
|
||||
TypeIdentifierDefinition type; // optional
|
||||
std::vector<std::pair<TypeIdentifierDefinition, std::unique_ptr<TupleType>>> constructors;
|
||||
std::optional<TypeIdentifierDefinition> type;
|
||||
std::vector<std::variant<TypeIdentifierDefinition, std::unique_ptr<TupleType>>> constructors;
|
||||
};
|
||||
|
||||
struct AnnotatedType : public Node {
|
||||
|
|
|
|||
|
|
@ -118,6 +118,8 @@ const std::string TypeclassExpression = "typeclass_expression";
|
|||
|
||||
// Identifiers, constants, etc. -----------------
|
||||
|
||||
const std::string TypeIdentifierDefinition = "type_identifier_definition";
|
||||
|
||||
const std::string TypeclassIdentifier = "typeclass_identifer";
|
||||
const std::string NameIdentifier = "name_identifier";
|
||||
const std::string TypeIdentifier = "type_identifer";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue