-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
27 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,40 @@ | ||
namespace vein.syntax | ||
{ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Sprache; | ||
|
||
public class QualifiedExpressionStatement : StatementSyntax, IPositionAware<QualifiedExpressionStatement> | ||
{ | ||
public readonly ExpressionSyntax Value; | ||
namespace vein.syntax; | ||
|
||
public QualifiedExpressionStatement(ExpressionSyntax exp) => Value = exp; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Sprache; | ||
|
||
public new QualifiedExpressionStatement SetPos(Position startPos, int length) | ||
{ | ||
base.SetPos(startPos, length); | ||
return this; | ||
} | ||
public class QualifiedExpressionStatement(ExpressionSyntax exp) | ||
: StatementSyntax, IPositionAware<QualifiedExpressionStatement> | ||
{ | ||
public readonly ExpressionSyntax Value = exp; | ||
|
||
public override string ExpressionString => Value.ExpressionString; | ||
public new QualifiedExpressionStatement SetPos(Position startPos, int length) | ||
{ | ||
base.SetPos(startPos, length); | ||
return this; | ||
} | ||
|
||
public class VariableDeclarationSyntax : StatementSyntax, IPositionAware<VariableDeclarationSyntax> | ||
{ | ||
public override SyntaxType Kind => SyntaxType.VariableDeclaration; | ||
public override string ExpressionString => Value.ExpressionString; | ||
} | ||
|
||
public override IEnumerable<BaseSyntax> ChildNodes => | ||
GetNodes(Type).Concat(new[] { Variable }).Where(n => n != null); | ||
public class VariableDeclarationSyntax : StatementSyntax, IPositionAware<VariableDeclarationSyntax> | ||
{ | ||
public override SyntaxType Kind => SyntaxType.VariableDeclaration; | ||
|
||
public TypeExpression Type { get; set; } | ||
public override IEnumerable<BaseSyntax> ChildNodes => | ||
GetNodes(Type).Concat(new[] { Variable }).Where(n => n != null); | ||
|
||
public IdentifierExpression Variable { get; set; } | ||
public TypeExpression Type { get; set; } | ||
|
||
public ExpressionSyntax ExpressionValue { get; set; } | ||
public IdentifierExpression Variable { get; set; } | ||
|
||
public ExpressionSyntax ExpressionValue { get; set; } | ||
|
||
public new VariableDeclarationSyntax SetPos(Position startPos, int length) | ||
{ | ||
base.SetPos(startPos, length); | ||
return this; | ||
} | ||
|
||
public new VariableDeclarationSyntax SetPos(Position startPos, int length) | ||
{ | ||
base.SetPos(startPos, length); | ||
return this; | ||
} | ||
} |