-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added a separate REPL syntax * Syntax updated * Update CompilerConstants.cs * Create Script.cs * Update Script.cs * Update Script.cs * Update Script.cs * Added compiler flag * Rename * Shuffling code * Fixed compilation * More API * Fixed test namespaces * Fixed binder cache * Added source script module * Parser fixes * Update SourceScriptModuleSymbol.cs * Added synthetized method * Moved * Better stuff * Docs * Update ScriptEvalFunctionSymbol.cs * Additional structures * Added bases for syntax based functions and globals * Factored out common stuff from source symbols * More symbol hammering * Update ScriptBinding.cs * Moved stuff * Update ScriptFunctionSymbol.cs * More logic * Update ScriptModuleSymbol.cs * Update Binder_Symbol.cs * Update Binder_Symbol.cs * Update Binder_Symbol.cs * Update Binder_Symbol.cs * Update Binder_Symbol.cs * Update Binder_Symbol.cs * Update Binder_Symbol.cs * Update Binder_Symbol.cs * Update Binder_Symbol.cs * Filled out * Update ScriptBinding.cs * Update SourceGlobalSymbol.cs * Bunch of fixes * Update Binder_Lookup.cs * ITS ALIVE * Update ScriptModuleSymbol.cs * Update ScriptEvalFunctionSymbol.cs * Shuffled code around * Fixes * More fixes * Fixes * Rename * Wrote is complete * More testing * Fixed * Cleanup * Nicer binder solution * Simplified
1 parent
280b45e
commit caf883a
Showing
46 changed files
with
1,408 additions
and
556 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
2 changes: 1 addition & 1 deletion
2
...mpiler.Tests/Repl/IsCompleteEntryTests.cs → ...r.Tests/Scripting/IsCompleteEntryTests.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
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.Collections.Immutable; | ||
using Draco.Compiler.Api; | ||
using Draco.Compiler.Api.Scripting; | ||
|
||
namespace Draco.Compiler.Tests.Scripting; | ||
|
||
public sealed class ScriptTests | ||
{ | ||
[Fact] | ||
public void BasicAssignmentAndAddition() | ||
{ | ||
// Arrange | ||
var script = Script.Create<int>(""" | ||
var x = 3; | ||
var y = 4; | ||
x + y | ||
""", | ||
// TODO: We could factor out BCL refs into some global, we repeat this LINQ a lot in tests | ||
metadataReferences: Basic.Reference.Assemblies.Net80.ReferenceInfos.All | ||
.Select(r => MetadataReference.FromPeStream(new MemoryStream(r.ImageBytes))) | ||
.ToImmutableArray()); | ||
|
||
// Act | ||
var result = script.Execute(); | ||
|
||
// Assert | ||
Assert.True(result.Success); | ||
Assert.Equal(7, result.Value); | ||
} | ||
} |
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.