mirror of
https://codeberg.org/ProgramSnail/lang.git
synced 2026-01-25 13:07:13 +00:00
fixes for updated grammar
This commit is contained in:
parent
f848c0a1d6
commit
1b28f41810
3 changed files with 32 additions and 5 deletions
2
deps/tree-sitter-lang
vendored
2
deps/tree-sitter-lang
vendored
|
|
@ -1 +1 @@
|
||||||
Subproject commit 3b4be40ef780faef07580545e9468dafedada79b
|
Subproject commit 567f75620da9609ee530442191aa4c1e18e7b9b4
|
||||||
27
include/statement_nodes.hpp
Normal file
27
include/statement_nodes.hpp
Normal 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
|
||||||
|
|
@ -42,7 +42,7 @@ enum class Type {
|
||||||
ARRAY_ACCESS,
|
ARRAY_ACCESS,
|
||||||
TUPLE_ACCESS,
|
TUPLE_ACCESS,
|
||||||
LOOP_CONTROL,
|
LOOP_CONTROL,
|
||||||
REFERENCE,
|
REFERENCE_EXPRESSION,
|
||||||
SUFFIX_EXPRESSION,
|
SUFFIX_EXPRESSION,
|
||||||
|
|
||||||
// --- other
|
// --- 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 ARRAY_ACCESS = "array_access";
|
||||||
const static std::string TUPLE_ACCESS = "tuple_access";
|
const static std::string TUPLE_ACCESS = "tuple_access";
|
||||||
const static std::string LOOP_CONTROL = "loop_control";
|
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";
|
const static std::string SUFFIX_EXPRESSION = "suffix_expression";
|
||||||
|
|
||||||
// --- other
|
// --- other
|
||||||
|
|
@ -208,8 +208,8 @@ inline Type string_to_type(const std::string &str) {
|
||||||
return Type::TUPLE_ACCESS;
|
return Type::TUPLE_ACCESS;
|
||||||
} else if (str == LOOP_CONTROL) {
|
} else if (str == LOOP_CONTROL) {
|
||||||
return Type::LOOP_CONTROL;
|
return Type::LOOP_CONTROL;
|
||||||
} else if (str == REFERENCE) {
|
} else if (str == REFERENCE_EXPRESSION) {
|
||||||
return Type::REFERENCE;
|
return Type::REFERENCE_EXPRESSION;
|
||||||
} else if (str == SUFFIX_EXPRESSION) {
|
} else if (str == SUFFIX_EXPRESSION) {
|
||||||
return Type::SUFFIX_EXPRESSION;
|
return Type::SUFFIX_EXPRESSION;
|
||||||
} else if (str == NAME_EXPRESSION) {
|
} else if (str == NAME_EXPRESSION) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue