-
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
45 changed files
with
4,054 additions
and
4,135 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
################################################################################ | ||
# This .gitignore file was automatically created by Microsoft(R) Visual Studio. | ||
################################################################################ | ||
|
||
/.vs | ||
/obj | ||
/bin | ||
/DScript/obj |
This file was deleted.
Oops, something went wrong.
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,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.30330.147 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DScript", "DScript/DScript.csproj", "{FC4BD1FC-B545-4EEA-AD76-A2ECE21EEDFE}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{FC4BD1FC-B545-4EEA-AD76-A2ECE21EEDFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{FC4BD1FC-B545-4EEA-AD76-A2ECE21EEDFE}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{FC4BD1FC-B545-4EEA-AD76-A2ECE21EEDFE}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{FC4BD1FC-B545-4EEA-AD76-A2ECE21EEDFE}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {2F9335D2-D60B-4F1D-926A-16CB06673EE6} | ||
EndGlobalSection | ||
EndGlobal |
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,18 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard2.1</TargetFramework> | ||
<PackageLicenseFile>LICENSE</PackageLicenseFile> | ||
<PackageProjectUrl>https://github.com/bizzehdee/DScript</PackageProjectUrl> | ||
<RepositoryUrl>https://github.com/bizzehdee/DScript</RepositoryUrl> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Remove="ScriptEngine.Factor.cs~RFa0fcdc3.TMP" /> | ||
<None Include="..\LICENSE"> | ||
<Pack>True</Pack> | ||
<PackagePath></PackagePath> | ||
</None> | ||
</ItemGroup> | ||
|
||
</Project> |
104 changes: 52 additions & 52 deletions
104
FunctionProviders/ConsoleFunctionProvider.cs → ...ctionProviders/ConsoleFunctionProvider.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 |
---|---|---|
@@ -1,52 +1,52 @@ | ||
/* | ||
Copyright (c) 2014 Darren Horrocks | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
*/ | ||
|
||
using System; | ||
|
||
namespace DScript.FunctionProviders | ||
{ | ||
[ScriptClass("Console")] | ||
public class ConsoleFunctionProvider | ||
{ | ||
public void WriteLine(String text, object userData) | ||
{ | ||
Console.WriteLine(text); | ||
} | ||
|
||
public String ReadLine(object userData) | ||
{ | ||
String retVal = Console.ReadLine(); | ||
return retVal; | ||
} | ||
|
||
public void Write(String text, object userData) | ||
{ | ||
Console.Write(text); | ||
} | ||
|
||
public Int32 ReadChar(object userData) | ||
{ | ||
Int32 retVal = Console.Read(); | ||
return retVal; | ||
} | ||
} | ||
} | ||
/* | ||
Copyright (c) 2014 - 2020 Darren Horrocks | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
*/ | ||
|
||
using System; | ||
|
||
namespace DScript.FunctionProviders | ||
{ | ||
[ScriptClass("Console")] | ||
public class ConsoleFunctionProvider | ||
{ | ||
public void WriteLine(string text, object userData) | ||
{ | ||
Console.WriteLine(text); | ||
} | ||
|
||
public string ReadLine(object userData) | ||
{ | ||
var retVal = Console.ReadLine(); | ||
return retVal; | ||
} | ||
|
||
public void Write(string text, object userData) | ||
{ | ||
Console.Write(text); | ||
} | ||
|
||
public int ReadChar(object userData) | ||
{ | ||
int retVal = Console.Read(); | ||
return retVal; | ||
} | ||
} | ||
} |
134 changes: 66 additions & 68 deletions
134
FunctionProviders/ConvertFunctionProvider.cs → ...ctionProviders/ConvertFunctionProvider.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 |
---|---|---|
@@ -1,68 +1,66 @@ | ||
/* | ||
Copyright (c) 2014 Darren Horrocks | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
*/ | ||
|
||
using System; | ||
|
||
namespace DScript.FunctionProviders | ||
{ | ||
[ScriptClass("Convert")] | ||
public class ConvertFunctionProvider | ||
{ | ||
public static String IntToString(Int32 val, object userData) | ||
{ | ||
return String.Format("{0}", val); | ||
} | ||
|
||
public static double IntToFloat(Int32 val, object userData) | ||
{ | ||
return val; | ||
} | ||
|
||
public static String FloatToString(double val, object userData) | ||
{ | ||
return String.Format("{0}", val); | ||
} | ||
|
||
public static Int32 FloatToInt(double val, object userData) | ||
{ | ||
return (Int32)val; | ||
} | ||
|
||
public static double StringToFloat(String val, object userData) | ||
{ | ||
double returnVal; | ||
|
||
double.TryParse(val, out returnVal); | ||
|
||
return returnVal; | ||
} | ||
|
||
public static Int32 StringToInt(String val, object userData) | ||
{ | ||
Int32 returnVal; | ||
|
||
Int32.TryParse(val, out returnVal); | ||
|
||
return returnVal; | ||
} | ||
} | ||
} | ||
/* | ||
Copyright (c) 2014 - 2020 Darren Horrocks | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
*/ | ||
|
||
using System; | ||
|
||
namespace DScript.FunctionProviders | ||
{ | ||
[ScriptClass("Convert")] | ||
public class ConvertFunctionProvider | ||
{ | ||
public static String IntToString(int val, object userData) | ||
{ | ||
return string.Format("{0}", val); | ||
} | ||
|
||
public static double IntToFloat(int val, object userData) | ||
{ | ||
return val; | ||
} | ||
|
||
public static string FloatToString(double val, object userData) | ||
{ | ||
return string.Format("{0}", val); | ||
} | ||
|
||
public static int FloatToInt(double val, object userData) | ||
{ | ||
return (int)val; | ||
} | ||
|
||
public static double StringToFloat(string val, object userData) | ||
{ | ||
|
||
double.TryParse(val, out double returnVal); | ||
|
||
return returnVal; | ||
} | ||
|
||
public static int StringToInt(string val, object userData) | ||
{ | ||
|
||
int.TryParse(val, out int returnVal); | ||
|
||
return returnVal; | ||
} | ||
} | ||
} |
Oops, something went wrong.