mirror of
https://codeberg.org/ProgramSnail/lang.git
synced 2025-12-07 23:48:44 +00:00
bug fixes, tests passed, result modifier (!) added to function arguments and to types
This commit is contained in:
parent
4470454838
commit
3914ff7d8b
16 changed files with 418 additions and 62 deletions
|
|
@ -72,6 +72,7 @@ build_expression(parser::ParseTree::Node parser_node,
|
|||
build_name_expression(parser_node, expression_storage, type_storage)));
|
||||
case tokens::Type::ARGUMENT_NAME_IDENTIFIER:
|
||||
case tokens::Type::SIMPLE_NAME_IDENTIFIER:
|
||||
case tokens::Type::PLACEHOLDER:
|
||||
return expression_storage.add_expression(
|
||||
nodes::Expression(nodes::NameExpression(
|
||||
build_node(parser_node), build_identifier(parser_node))));
|
||||
|
|
@ -501,13 +502,15 @@ nodes::Lambda build_lambda(parser::ParseTree::Node parser_node,
|
|||
nodes::TypeStorage &type_storage) {
|
||||
std::vector<nodes::Identifier> arguments;
|
||||
|
||||
auto current_node = parser_node.nth_child(1); // next to '\\'
|
||||
auto current_node =
|
||||
parser_node.nth_child(1); // next to '\\', not null ('=>' should present)
|
||||
|
||||
while (current_node.is_named()) { // until _do_
|
||||
arguments.emplace_back(build_identifier(parser_node));
|
||||
arguments.emplace_back(build_identifier(current_node));
|
||||
current_node = current_node.next_sibling();
|
||||
}
|
||||
|
||||
// skip '=>'
|
||||
current_node = current_node.next_named_sibling();
|
||||
|
||||
return nodes::Lambda(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue