-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added multi assignment. a, b, c = 2;
- Loading branch information
1 parent
f92d75d
commit 3dfb004
Showing
8 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Hassium.Compiler.Parser.Ast | ||
{ | ||
public class MultiAssignmentNode: AstNode | ||
{ | ||
public List<BinaryOperationNode> Assignments { get; private set; } | ||
|
||
public MultiAssignmentNode(List<AstNode> left, AstNode value) | ||
{ | ||
Assignments = new List<BinaryOperationNode>(); | ||
foreach (var ast in left) | ||
Assignments.Add(new BinaryOperationNode(value.SourceLocation, BinaryOperation.Assignment, ast, value)); | ||
} | ||
|
||
public override void Visit(IVisitor visitor) | ||
{ | ||
visitor.Accept(this); | ||
} | ||
public override void VisitChildren(IVisitor visitor) | ||
{ | ||
foreach (AstNode child in Children) | ||
child.Visit(visitor); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters