Skip to content

Commit

Permalink
Merge pull request #24 from kelnishi/expr-compiler
Browse files Browse the repository at this point in the history
Expr compiler
  • Loading branch information
kelnishi authored Nov 25, 2024
2 parents b8cd715 + 521b140 commit fd99044
Show file tree
Hide file tree
Showing 80 changed files with 3,609 additions and 1,948 deletions.
1 change: 1 addition & 0 deletions .run/Package Unity.run.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Package Unity" type="CompoundRunConfigurationType">
<toRun name="Sync Versions" type="ShConfigurationType" />
<toRun name="Wacs.Core Publish Wacs.Core.dll" type="ShConfigurationType" />
<toRun name="Wacs.Core Publish Wacs.WASIp1.dll" type="ShConfigurationType" />
<method v="2" />
Expand Down
1 change: 1 addition & 0 deletions Spec.Test/WastTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public void RunWast(WastJson.WastJson file)

//Make multiple memories fail validation
ModuleValidator.ValidateMultipleMemories = false;
runtime.TranspileModules = true;

Module? module = null;
foreach (var command in file.Commands)
Expand Down
3 changes: 3 additions & 0 deletions Wacs.Console/CommandLineOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ public class CommandLineOptions

[Option('i', "invoke", HelpText = "Call a specific function.")]
public string InvokeFunction { get; set; } = "";

[Option('t', "transpiler", HelpText = "Invoke the transpiler on instantiated module")]
public bool Transpile { get; set; }

// This will capture all values that aren't tied to an option
[Value(0, Required = true, MetaName = "WasmModule", HelpText = "Path to the executable")]
Expand Down
4 changes: 3 additions & 1 deletion Wacs.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ static int RunWithOptions(CommandLineOptions opts)
//Validation normally happens after instantiation, but you can skip it if you did it after parsing, or you're like super confident.
var modInst = runtime.InstantiateModule(module, new RuntimeOptions { SkipModuleValidation = true});
runtime.RegisterModule(moduleName, modInst);


if (opts.Transpile)
runtime.TranspileModule(modInst);

var callOptions = new InvokerOptions {
LogGas = opts.LogGas,
Expand Down
Loading

0 comments on commit fd99044

Please sign in to comment.