"...tools/nunit3-console.exe.config" did not exist on "6b188728f7d54f10aa46cdb3b45008e7a9707f0d"
Commit b969a882 authored by Megax's avatar Megax
Browse files

* Project fajlok at lettek alakitva. Igy most mindegyik normalisan hasznalhato...

* Project fajlok at lettek alakitva. Igy most mindegyik normalisan hasznalhato forditasnal. Nincsenek hibak. KopiLua-ba kerult egy fix. Nem ertem mitol jott elo az a hiba ami elojott de most van a kodban (vagy is volt mert fixaltam).
parent d7bb0c93
using System;
using LuaInterface;
using System.Threading;
/*
* Application to run Lua scripts that can use LuaInterface
* from the console
*
* Author: Fabio Mascarenhas
* Version: 1.0
*/
namespace LuaRunner
{
public class LuaNetRunner
{
/*
* Runs the Lua script passed as the first command-line argument.
* It passed all the command-line arguments to the script.
*/
[STAThread] // steffenj: testluaform.lua "Load" button complained with an exception that STAThread was missing
public static void Main(string[] args)
{
if(args.Length > 0)
{
// For attaching from the debugger
// Thread.Sleep(20000);
using (Lua lua = new Lua())
{
//lua.OpenLibs(); // steffenj: Lua 5.1.1 API change (all libs already opened in Lua constructor!)
lua.NewTable("arg");
LuaTable argc = (LuaTable)lua["arg"];
argc[-1] = "LuaRunner";
argc[0] = args[0];
for (int i = 1; i < args.Length; i++)
{
argc[i] = args[i];
}
argc["n"] = args.Length - 1;
try
{
//Console.WriteLine("DoFile(" + args[0] + ");");
lua.DoFile(args[0]);
}
catch (Exception e)
{
// steffenj: BEGIN error message improved, output is now in decending order of importance (message, where, stacktrace)
// limit size of strack traceback message to roughly 1 console screen height
string trace = e.StackTrace;
if (e.StackTrace.Length > 1300)
trace = e.StackTrace.Substring(0, 1300) + " [...] (traceback cut short)";
Console.WriteLine();
Console.WriteLine(e.Message);
Console.WriteLine(e.Source + " raised a " + e.GetType().ToString());
Console.WriteLine(trace);
// wait for keypress if there is an error
Console.ReadKey();
// steffenj: END error message improved
}
}
}
else
{
Console.WriteLine("LuaRunner -- runs Lua scripts with CLR access");
Console.WriteLine("Usage: luarunner <script.lua> [{<arg>}]");
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LuaRunner</RootNamespace>
<AssemblyName>LuaRunner</AssemblyName>
<ReleaseVersion>2.x</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\Run\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\Run\Release</OutputPath>
<DefineConstants>RELEASE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\Run\Debug_x64</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x64</PlatformTarget>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\Run\Release_x64</OutputPath>
<DefineConstants>RELEASE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x64</PlatformTarget>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="LuaNetRunner.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Core\LuaInterface\LuaInterface.csproj">
<Project>{F55CABBB-4108-4A39-94E1-581FD46DC021}</Project>
<Name>LuaInterface</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("LuaRunner")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LuaRunner")]
[assembly: AssemblyCopyright("Copyright © 2006")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("0db73438-fb76-4991-b61d-3c072d340154")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.5.2")]
[assembly: AssemblyFileVersion("1.5.2")]
\ No newline at end of file
......@@ -2,7 +2,7 @@
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}</ProjectGuid>
......@@ -10,55 +10,54 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Lua</RootNamespace>
<AssemblyName>KopiLua</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<ReleaseVersion>2.x</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\Run\Debug</OutputPath>
<DefineConstants>TRACE;DEBUG;LUA_CORE;_WIN32;LUA_COMPAT_VARARG;LUA_COMPAT_MOD;LUA_COMPAT_GFIND;CATCH_EXCEPTIONS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\Run\Release</OutputPath>
<DefineConstants>TRACE;RELEASE;LUA_CORE;_WIN32;LUA_COMPAT_VARARG;LUA_COMPAT_MOD;LUA_COMPAT_GFIND;CATCH_EXCEPTIONS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<OutputPath>..\..\Run\Debug_x64</OutputPath>
<DefineConstants>TRACE;DEBUG;LUA_CORE;_WIN32;LUA_COMPAT_VARARG;LUA_COMPAT_MOD;LUA_COMPAT_GFIND;CATCH_EXCEPTIONS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x64</PlatformTarget>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;LUA_CORE;_WIN32;LUA_COMPAT_VARARG;LUA_COMPAT_MOD;LUA_COMPAT_GFIND;CATCH_EXCEPTIONS</DefineConstants>
<OutputPath>..\..\Run\Release_x64</OutputPath>
<DefineConstants>TRACE;RELEASE;LUA_CORE;_WIN32;LUA_COMPAT_VARARG;LUA_COMPAT_MOD;LUA_COMPAT_GFIND;CATCH_EXCEPTIONS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x64</PlatformTarget>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
</ItemGroup>
<ItemGroup>
......
......@@ -523,6 +523,7 @@ namespace KopiLua
public static void lua_pushlightuserdata (lua_State L, object p) {
lua_lock(L);
setpvalue(L.top, p);
Console.WriteLine(L.top.value.p.GetType());
api_incr_top(L);
lua_unlock(L);
}
......
......@@ -168,6 +168,7 @@ namespace KopiLua
#endif
{
f(L, ud);
Console.WriteLine(lj.status);
}
#if CATCH_EXCEPTIONS
catch
......@@ -306,7 +307,10 @@ namespace KopiLua
StkId p;
ptrdiff_t funcr = savestack(L, func);
if (!ttisfunction(tm))
{
Console.WriteLine(false);
luaG_typeerror(L, func, "call");
}
/* Open a hole inside the stack at `func' */
for (p = L.top; p > func; StkId.dec(ref p)) setobjs2s(L, p, p - 1);
incr_top(L);
......@@ -329,11 +333,16 @@ namespace KopiLua
public static int luaD_precall (lua_State L, StkId func, int nresults) {
LClosure cl;
ptrdiff_t funcr;
Console.WriteLine(15);
if (!ttisfunction(func)) /* `func' is not a function? */
func = tryfuncTM(L, func); /* check the `function' tag method */
Console.WriteLine(16);
funcr = savestack(L, func);
Console.WriteLine(20);
cl = clvalue(func).l;
Console.WriteLine(30);
L.ci.savedpc = InstructionPtr.Assign(L.savedpc);
Console.WriteLine(300);
if (cl.isC==0) { /* Lua function? prepare its call */
CallInfo ci;
StkId st, base_;
......@@ -369,6 +378,7 @@ namespace KopiLua
return PCRLUA;
}
else { /* if is a C function, call it */
Console.WriteLine(301);
CallInfo ci;
int n;
luaD_checkstack(L, LUA_MINSTACK); /* ensure minimum stack size */
......@@ -436,16 +446,24 @@ namespace KopiLua
** function position.
*/
private static void luaD_call (lua_State L, StkId func, int nResults) {
Console.WriteLine("asd");
if (++L.nCcalls >= LUAI_MAXCCALLS) {
if (L.nCcalls == LUAI_MAXCCALLS)
luaG_runerror(L, "C stack overflow");
else if (L.nCcalls >= (LUAI_MAXCCALLS + (LUAI_MAXCCALLS>>3)))
luaD_throw(L, LUA_ERRERR); /* error while handing stack error */
}
if (luaD_precall(L, func, nResults) == PCRLUA) /* is a Lua function? */
{
Console.WriteLine("asd30");
luaV_execute(L, 1); /* call it */
Console.WriteLine("asd3");
}
L.nCcalls--;
Console.WriteLine("asd4");
luaC_checkGC(L);
Console.WriteLine("asd5");
}
......@@ -530,6 +548,7 @@ namespace KopiLua
ptrdiff_t old_errfunc = L.errfunc;
L.errfunc = ef;
status = luaD_rawrunprotected(L, func, u);
Console.WriteLine("status: " + status.ToString());
if (status != 0) { /* an error occurred? */
StkId oldtop = restorestack(L, old_top);
luaF_close(L, oldtop); /* close eventual pending closures */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment