Skip to content

Commit

Permalink
(#72) Merge with main
Browse files Browse the repository at this point in the history
  • Loading branch information
ForNeVeR committed Jul 23, 2022
1 parent b63171e commit 204bb58
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Cesium.Ast/Statements.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ public record ForStatement(
Expression? InitExpression,
Expression? TestExpression,
Expression? UpdateExpression,
Statement Body) : Statement;
IBlockItem Body) : Statement;

// 6.8.6 Jump statements
public record GoToStatement(string Identifier) : Statement;

public record BreakStatement : Statement;

public record ReturnStatement(Expression Expression) : Statement;
public record ReturnStatement(Expression Expression) : Statement;
6 changes: 3 additions & 3 deletions Cesium.CodeGen/Ir/BlockItems/AmbiguousBlockItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public AmbiguousBlockItem(Ast.AmbiguousBlockItem item)

public IBlockItem Lower() => this;

public void EmitTo(FunctionScope scope)
public void EmitTo(IDeclarationScope scope)
{
// Check if this can be a valid variable declaration:
var typeReference = scope.Context.GetTypeReference(_item1);
Expand All @@ -49,12 +49,12 @@ public void EmitTo(FunctionScope scope)
$" but it's ambiguous which it is, since both a function and a type of name {_item1} exist.");
}

private void EmitVariableDeclaration(FunctionScope scope)
private void EmitVariableDeclaration(IDeclarationScope scope)
{
throw new NotImplementedException("Ambiguous variable declarations aren't supported, yet.");
}

private void EmitFunctionCall(FunctionScope scope)
private void EmitFunctionCall(IDeclarationScope scope)
{
CToken CreateFakeToken(string id) => new(new Range(), id, new Range(), id, CTokenType.Identifier);

Expand Down
2 changes: 1 addition & 1 deletion Cesium.Parser/CParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ private static ForStatement MakeForStatement(
ICToken ____,
Expression updateExpression,
ICToken _____,
Statement body)
IBlockItem body)
=> new(initExpression, testExpression, updateExpression, body);

// 6.8.6 Jump statements
Expand Down

0 comments on commit 204bb58

Please sign in to comment.