mirror of
https://codeberg.org/ProgramSnail/lang.git
synced 2025-12-06 15:08:48 +00:00
statements builders start
This commit is contained in:
parent
0e6d4bd67f
commit
64a91299ff
3 changed files with 107 additions and 5 deletions
54
src/statement_builders.cpp
Normal file
54
src/statement_builders.cpp
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
#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
|
||||
Loading…
Add table
Add a link
Reference in a new issue