-
Notifications
You must be signed in to change notification settings - Fork 2
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
20 changed files
with
225 additions
and
2 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 |
---|---|---|
|
@@ -10,6 +10,7 @@ public enum DynamicValueType | |
Array, | ||
Fiber, | ||
Chunk, | ||
Error, | ||
TypeCode, | ||
NativeFunction, | ||
NativeObject | ||
|
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,15 @@ | ||
using EVIL.Grammar.AST.Base; | ||
|
||
namespace EVIL.Grammar.AST.Expressions | ||
{ | ||
public class ErrorExpression : Expression | ||
{ | ||
public TableExpression UserDataTable { get; } | ||
|
||
public ErrorExpression(TableExpression userDataTable) | ||
{ | ||
UserDataTable = userDataTable; | ||
Reparent(UserDataTable); | ||
} | ||
} | ||
} |
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
17 changes: 17 additions & 0 deletions
17
Core/EVIL.Grammar/Parsing/Expressions/Parser.ErrorExpression.cs
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,17 @@ | ||
using EVIL.Grammar.AST.Expressions; | ||
using EVIL.Lexical; | ||
|
||
namespace EVIL.Grammar.Parsing | ||
{ | ||
public partial class Parser | ||
{ | ||
private ErrorExpression ErrorExpression() | ||
{ | ||
var (line, col) = Match(Token.Error); | ||
var userData = TableExpression(); | ||
|
||
return new ErrorExpression(userData) | ||
{ Line = line, Column = col }; | ||
} | ||
} | ||
} |
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
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,44 @@ | ||
using Ceres.ExecutionEngine.Collections; | ||
using Ceres.ExecutionEngine.TypeSystem; | ||
|
||
namespace Ceres.ExecutionEngine.Diagnostics | ||
{ | ||
public class Error | ||
{ | ||
private Table UserData { get; } = new(); | ||
|
||
public int Length => UserData.Length; | ||
|
||
public DynamicValue this[DynamicValue key] | ||
{ | ||
get => UserData[key]; | ||
set => UserData[key] = value; | ||
} | ||
|
||
public Error() | ||
{ | ||
} | ||
|
||
public Error(Table userData) | ||
{ | ||
UserData = userData; | ||
} | ||
|
||
public Error(string message) | ||
{ | ||
UserData["msg"] = message; | ||
} | ||
|
||
public Error(Table userData, string message) | ||
{ | ||
UserData = userData; | ||
UserData["msg"] = message; | ||
} | ||
|
||
public bool Contains(DynamicValue key) | ||
=> UserData.Contains(key); | ||
|
||
public bool IsDeeplyEqualTo(Error other) | ||
=> UserData.IsDeeplyEqualTo(other.UserData); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -72,6 +72,7 @@ public enum OpCode : byte | |
OVERRIDE, | ||
ENTER, | ||
THROW, | ||
LEAVE | ||
LEAVE, | ||
ERRNEW | ||
} | ||
} |
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
Oops, something went wrong.