mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2025-12-06 06:58:45 +00:00
type_constructor_pattern fix
This commit is contained in:
parent
6e986f9a33
commit
c31b20fa24
5 changed files with 30642 additions and 30617 deletions
|
|
@ -382,7 +382,7 @@ struct TypeConstructorPatternParameter {
|
|||
};
|
||||
|
||||
struct TypeConstructorPattern {
|
||||
TypeIdentifier constructor;
|
||||
std::unique_ptr<TypeExpression> constructor;
|
||||
std::vector<TypeConstructorPatternParameter> parameters;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -423,7 +423,8 @@ void BuildVisitor::Visit(TypeConstructorPatternParameter* node) {
|
|||
void BuildVisitor::Visit(TypeConstructorPattern* node) {
|
||||
auto parse_node = current_node_;
|
||||
|
||||
node->constructor = parse_node.ChildByFieldName("constructor").GetValue();
|
||||
current_node_ = parse_node.ChildByFieldName("constructor");
|
||||
Visit(node->constructor.get());
|
||||
|
||||
size_t child_count = parse_node.NamedChildCount();
|
||||
|
||||
|
|
|
|||
61250
src/parser.c
61250
src/parser.c
File diff suppressed because it is too large
Load diff
|
|
@ -265,7 +265,7 @@ void PrintVisitor::Visit(TypeConstructorPatternParameter* node) {
|
|||
|
||||
void PrintVisitor::Visit(TypeConstructorPattern* node) {
|
||||
out_ << "[TypeConstructorPattern ";
|
||||
Visit(&node->constructor);
|
||||
Visit(node->constructor.get());
|
||||
out_ << "]\n(";
|
||||
|
||||
bool is_first = true;
|
||||
|
|
|
|||
|
|
@ -459,7 +459,7 @@ void Visitor::Visit(TypeConstructorPatternParameter* node) {
|
|||
}
|
||||
|
||||
void Visitor::Visit(TypeConstructorPattern* node) {
|
||||
Visit(&node->constructor);
|
||||
Visit(node->constructor.get());
|
||||
for (auto& parameter : node->parameters) {
|
||||
Visit(¶meter);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue