Skip to content

Commit bb93156

Browse files
committed
Merge branch 'refs/heads/feature/bsl-process' into develop
# Conflicts: # src/OneScript.Web.Server/WebServer.cs
2 parents 6800843 + 5763d56 commit bb93156

File tree

142 files changed

+1571
-1248
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+1571
-1248
lines changed

src/OneScript.Core/Commons/Utils.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ This Source Code Form is subject to the terms of the
55
at http://mozilla.org/MPL/2.0/.
66
----------------------------------------------------------*/
77
using System;
8-
using System.Collections;
98
using System.Collections.Generic;
10-
using System.Linq;
119

1210
namespace OneScript.Commons
1311
{

src/OneScript.Core/Compilation/Binding/SymbolTable.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ This Source Code Form is subject to the terms of the
55
at http://mozilla.org/MPL/2.0/.
66
----------------------------------------------------------*/
77

8-
using System;
98
using System.Collections.Generic;
109
using OneScript.Contexts;
1110

src/OneScript.Core/Compilation/CompilerFrontendBase.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ public SymbolScope FillSymbols(Type targetType)
5555

5656
private SymbolScope ModuleSymbols { get; set; }
5757

58-
public IExecutableModule Compile(SourceCode source, Type classType = null)
58+
public IExecutableModule Compile(SourceCode source, IBslProcess process, Type classType = null)
5959
{
6060
var lexer = CreatePreprocessor(source);
6161
var symbols = PrepareSymbols();
6262
var parsedModule = ParseSyntaxConstruction(lexer, source, p => p.ParseStatefulModule());
6363

64-
return CompileInternal(symbols, parsedModule, classType);
64+
return CompileInternal(symbols, parsedModule, classType, process);
6565
}
6666

6767
public IExecutableModule CompileExpression(SourceCode source)
@@ -85,7 +85,7 @@ public IExecutableModule CompileBatch(SourceCode source)
8585
return CompileBatchInternal(symbols, parsedModule);
8686
}
8787

88-
protected abstract IExecutableModule CompileInternal(SymbolTable symbols, ModuleNode parsedModule, Type classType);
88+
protected abstract IExecutableModule CompileInternal(SymbolTable symbols, ModuleNode parsedModule, Type classType, IBslProcess process);
8989

9090
protected abstract IExecutableModule CompileExpressionInternal(SymbolTable symbols, ModuleNode parsedModule);
9191

src/OneScript.Core/Compilation/ICompileTimeDependencyResolver.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ This Source Code Form is subject to the terms of the
55
at http://mozilla.org/MPL/2.0/.
66
----------------------------------------------------------*/
77

8+
using OneScript.Execution;
89
using OneScript.Sources;
910

1011
namespace OneScript.Compilation
@@ -16,6 +17,7 @@ public interface ICompileTimeDependencyResolver
1617
/// </summary>
1718
/// <param name="module">Модуль в котором объявлен импорт</param>
1819
/// <param name="libraryName">имя библиотеки</param>
19-
void Resolve(SourceCode module, string libraryName);
20+
/// <param name="process"></param>
21+
void Resolve(SourceCode module, string libraryName, IBslProcess process);
2022
}
2123
}

src/OneScript.Core/Compilation/ICompilerBackend.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ public interface ICompilerBackend
2121

2222
public SymbolTable Symbols { get; set; }
2323

24-
IExecutableModule Compile(ModuleNode parsedModule, Type classType);
24+
IExecutableModule Compile(ModuleNode parsedModule, Type classType, IBslProcess process);
2525
}
2626
}

src/OneScript.Core/Compilation/ICompilerFrontend.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public interface ICompilerFrontend
2727

2828
IErrorSink ErrorSink { get; }
2929

30-
IExecutableModule Compile(SourceCode source, Type classType = null);
30+
IExecutableModule Compile(SourceCode source, IBslProcess process, Type classType = null);
3131

3232
IExecutableModule CompileExpression(SourceCode source);
3333

src/OneScript.Core/Contexts/BslFieldBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public BslFieldBuilder SetDispatchingIndex(int index)
6363
return this;
6464
}
6565

66-
public BslFieldInfo Build()
66+
public BslScriptFieldInfo Build()
6767
{
6868
var scriptField = _member as BslScriptFieldInfo;
6969
Debug.Assert(scriptField != null);

src/OneScript.Core/Contexts/BslMethodInfo.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ This Source Code Form is subject to the terms of the
66
----------------------------------------------------------*/
77

88
using System;
9-
using System.Collections.Generic;
109
using System.Linq;
1110
using System.Reflection;
12-
using OneScript.Localization;
1311

1412
namespace OneScript.Contexts
1513
{

src/OneScript.Core/Contexts/ContextClassAttribute.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,5 @@ public string GetAlias()
3737
{
3838
return _alias;
3939
}
40-
41-
public string TypeUUID { get; set; }
42-
4340
}
4441
}

src/OneScript.Core/Contexts/ContextMethodInfo.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ This Source Code Form is subject to the terms of the
1010
using System.Linq;
1111
using System.Reflection;
1212
using OneScript.Commons;
13+
using OneScript.Execution;
1314

1415
namespace OneScript.Contexts
1516
{
@@ -39,6 +40,7 @@ public ContextMethodInfo(MethodInfo realMethod, ContextMethodAttribute binding)
3940
{
4041
_realMethod = realMethod;
4142
_scriptMark = binding;
43+
InjectsProcess = _realMethod.GetParameters().FirstOrDefault()?.ParameterType == typeof(IBslProcess);
4244
}
4345

4446
public override Type ReturnType => _realMethod.ReturnType;
@@ -101,6 +103,8 @@ public override MethodInfo GetBaseDefinition()
101103

102104
public object UnderlyingObject => _realMethod;
103105

106+
public bool InjectsProcess { get; }
107+
104108
public MethodInfo GetWrappedMethod() => _realMethod;
105109
}
106110
}

0 commit comments

Comments
 (0)