Skip to content

Commit b577772

Browse files
committed
#200 - InputStatement -> OutputStatement
1 parent 290d02d commit b577772

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

src/Application/HydraScript.Application.CodeGeneration/Visitors/InstructionProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ internal class InstructionProvider : VisitorBase<IAbstractSyntaxTreeNode, Addres
2424
IVisitor<FunctionDeclaration, AddressedInstructions>,
2525
IVisitor<WhileStatement, AddressedInstructions>,
2626
IVisitor<IfStatement, AddressedInstructions>,
27-
IVisitor<PrintStatement, AddressedInstructions>
27+
IVisitor<OutputStatement, AddressedInstructions>
2828
{
2929
private readonly IValueFactory _valueFactory;
3030
private readonly IVisitor<IAbstractSyntaxTreeNode, AddressedInstructions> _expressionVisitor;
@@ -230,7 +230,7 @@ public AddressedInstructions Visit(IfStatement visitable)
230230
return result;
231231
}
232232

233-
public AddressedInstructions Visit(PrintStatement visitable)
233+
public AddressedInstructions Visit(OutputStatement visitable)
234234
{
235235
if (visitable.Expression is PrimaryExpression prim)
236236
{

src/Application/HydraScript.Application.StaticAnalysis/Visitors/SemanticChecker.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ internal class SemanticChecker : VisitorBase<IAbstractSyntaxTreeNode, Type>,
4242
IVisitor<CallExpression, Type>,
4343
IVisitor<FunctionDeclaration, Type>,
4444
IVisitor<BlockStatement, Type>,
45-
IVisitor<PrintStatement, Type>
45+
IVisitor<OutputStatement, Type>
4646
{
4747
private readonly IDefaultValueForTypeCalculator _calculator;
4848
private readonly IFunctionWithUndefinedReturnStorage _functionStorage;
@@ -548,7 +548,7 @@ public Type Visit(BlockStatement visitable)
548548
return "undefined";
549549
}
550550

551-
public Type Visit(PrintStatement visitable)
551+
public Type Visit(OutputStatement visitable)
552552
{
553553
visitable.Expression.Accept(This);
554554
return "undefined";

src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Statements/PrintStatement.cs renamed to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Statements/OutputStatement.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Statements;
22

33
[AutoVisitable<IAbstractSyntaxTreeNode>]
4-
public partial class PrintStatement : Statement
4+
public partial class OutputStatement : Statement
55
{
66
protected override IReadOnlyList<IAbstractSyntaxTreeNode> Children { get; }
77

88
public Expression Expression { get; }
99

10-
public PrintStatement(Expression expression)
10+
public OutputStatement(Expression expression)
1111
{
1212
Expression = expression;
1313
Expression.Parent = this;

src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/TopDownParser.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ private StatementListItem StatementListItem()
114114
/// ContinueStatement
115115
/// BreakStatement
116116
/// ReturnStatement
117-
/// PrintStatement
117+
/// OutputStatement
118118
/// </summary>
119119
private Statement Statement()
120120
{
@@ -147,7 +147,7 @@ private Statement Statement()
147147
return WhileStatement();
148148

149149
if (CurrentIs("Print"))
150-
return PrintStatement();
150+
return OutputStatement();
151151

152152
return null!;
153153
}
@@ -220,12 +220,12 @@ private WhileStatement WhileStatement()
220220
}
221221

222222
/// <summary>
223-
/// PrintStatement -> '>>>' Expression
223+
/// OutputStatement -> '>>>' Expression
224224
/// </summary>
225-
private PrintStatement PrintStatement()
225+
private OutputStatement OutputStatement()
226226
{
227227
Expect("Print");
228-
return new PrintStatement(Expression());
228+
return new OutputStatement(Expression());
229229
}
230230

231231
/// <summary>

src/Domain/HydraScript.Domain.FrontEnd/Parser/grammar.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Statement -> BlockStatement
1010
ContinueStatement
1111
BreakStatement
1212
ReturnStatement
13-
PrintStatement
13+
OutputStatement
1414

1515
Declaration -> LexicalDeclaration
1616
FunctionDeclaration
@@ -67,7 +67,7 @@ BreakStatement -> 'break'
6767

6868
ReturnStatement -> 'return' Expression?
6969

70-
PrintStatement -> '>>>' Expression
70+
OutputStatement -> '>>>' Expression
7171

7272
TypeDeclaration -> 'type' "Ident" = TypeValue
7373
TypeValue -> TypeValueBase TypeValueSuffix*

0 commit comments

Comments
 (0)