fixes for updated grammar

This commit is contained in:
ProgramSnail 2023-07-19 11:02:11 +03:00
parent f848c0a1d6
commit 1b28f41810
3 changed files with 32 additions and 5 deletions

@ -1 +1 @@
Subproject commit 3b4be40ef780faef07580545e9468dafedada79b
Subproject commit 567f75620da9609ee530442191aa4c1e18e7b9b4

View file

@ -0,0 +1,27 @@
#pragma once
#include "basic_nodes.hpp"
#include <vector>
// IN PROGRESS
namespace nodes {
class Import : public Node {
public:
private:
Identifier import_name_;
Identifier module_name_;
std::vector<Identifier> symbols_;
}; // IN PROGRESS
class Constraint : public Node {}; // IN PROGRESS
class TypeDefinition : public Node {}; // IN PROGRESS
class FunctionDefinition : public Node {}; // IN PROGRESS
class TypeclassDefinition : public Node {}; // IN PROGRESS
} // namespace nodes

View file

@ -42,7 +42,7 @@ enum class Type {
ARRAY_ACCESS,
TUPLE_ACCESS,
LOOP_CONTROL,
REFERENCE,
REFERENCE_EXPRESSION,
SUFFIX_EXPRESSION,
// --- other
@ -126,7 +126,7 @@ const static std::string NAME_DEFINITION = "name_definition";
const static std::string ARRAY_ACCESS = "array_access";
const static std::string TUPLE_ACCESS = "tuple_access";
const static std::string LOOP_CONTROL = "loop_control";
const static std::string REFERENCE = "reference";
const static std::string REFERENCE_EXPRESSION = "reference_expression";
const static std::string SUFFIX_EXPRESSION = "suffix_expression";
// --- other
@ -208,8 +208,8 @@ inline Type string_to_type(const std::string &str) {
return Type::TUPLE_ACCESS;
} else if (str == LOOP_CONTROL) {
return Type::LOOP_CONTROL;
} else if (str == REFERENCE) {
return Type::REFERENCE;
} else if (str == REFERENCE_EXPRESSION) {
return Type::REFERENCE_EXPRESSION;
} else if (str == SUFFIX_EXPRESSION) {
return Type::SUFFIX_EXPRESSION;
} else if (str == NAME_EXPRESSION) {