mirror of
https://codeberg.org/ProgramSnail/lang.git
synced 2025-12-07 07:28:45 +00:00
55 lines
2.4 KiB
C++
55 lines
2.4 KiB
C++
|
|
#include "../include/statement_builders.hpp"
|
||
|
|
|
||
|
|
#include "statement_nodes.hpp"
|
||
|
|
#include "tree_sitter_wrapper.hpp"
|
||
|
|
|
||
|
|
namespace builders {
|
||
|
|
|
||
|
|
// IN PROGRESS: return type, etc.
|
||
|
|
void build_source_file(parser::ParseTree::Node parse_node,
|
||
|
|
nodes::ExpressionStorage &expression_storage,
|
||
|
|
nodes::TypeStorage &type_storage) {} // IN PROCESS
|
||
|
|
|
||
|
|
// IN PROGRESS: return type, etc.
|
||
|
|
void build_statement(parser::ParseTree::Node parse_node,
|
||
|
|
nodes::ExpressionStorage &expression_storage,
|
||
|
|
nodes::TypeStorage &type_storage) {} // IN PROCESS
|
||
|
|
|
||
|
|
// ('::' | 'import') simple_name ('=' simple_name)? (':' identifier*)?
|
||
|
|
nodes::Import build_import(parser::ParseTree::Node parse_node,
|
||
|
|
nodes::ExpressionStorage &expression_storage,
|
||
|
|
nodes::TypeStorage &type_storage) {} // IN PROCESS
|
||
|
|
|
||
|
|
// '?' expression
|
||
|
|
nodes::Constraint build_constraint(parser::ParseTree::Node parse_node,
|
||
|
|
nodes::ExpressionStorage &expression_storage,
|
||
|
|
nodes::TypeStorage &type_storage) {
|
||
|
|
} // IN PROCESS
|
||
|
|
|
||
|
|
// definition_info? annotation_info* '^'? simple_type (argument_type* '='
|
||
|
|
// (variant_type | tuple_type))? ('{' function_definition* '}' | ';')
|
||
|
|
nodes::TypeDefinition
|
||
|
|
build_type_definition(parser::ParseTree::Node parse_node,
|
||
|
|
nodes::ExpressionStorage &expression_storage,
|
||
|
|
nodes::TypeStorage &type_storage) {} // IN PROCESS
|
||
|
|
|
||
|
|
// TODO: make references possible only at one place at once
|
||
|
|
|
||
|
|
// definition_info? annotation_info* (constraint ';')* (simple_name | '('
|
||
|
|
// operator ')') (annotation? _reference_? argument_name '?'?)* (: (annotation?
|
||
|
|
// _reference_ type)+)?
|
||
|
|
// ('=' (block | expression ';') | ';')
|
||
|
|
nodes::FunctionDefinition
|
||
|
|
build_function_definition(parser::ParseTree::Node parse_node,
|
||
|
|
nodes::ExpressionStorage &expression_storage,
|
||
|
|
nodes::TypeStorage &type_storage) {} // IN PROCESS
|
||
|
|
|
||
|
|
// definition_info? annotation_info* typeclass_identifier (':'
|
||
|
|
// typeclass_identifier+)? ('{' function_definition* '}' | ';')
|
||
|
|
nodes::TypeclassDefinition
|
||
|
|
build_typeclass_definition(parser::ParseTree::Node parse_node,
|
||
|
|
nodes::ExpressionStorage &expression_storage,
|
||
|
|
nodes::TypeStorage &type_storage) {} // IN PROCESS
|
||
|
|
|
||
|
|
} // namespace builders
|