Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
indent_style = space
indent_size = 4
tab_width = 4
trim_trailing_whitespace = true
insert_final_newline = true
charset=utf-8

[*.{cs,vb}]
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = false
5 changes: 5 additions & 0 deletions ServerCodeExciser.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.2.32526.322
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{FA80E53A-9EEF-4F05-BEE3-EC8393F1975B}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ServerCodeExciser", "ServerCodeExciser\ServerCodeExciser.csproj", "{6E4116C9-9BEB-4FBA-B035-D91555E2C981}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ServerCodeExciserTest", "ServerCodeExciserTest\ServerCodeExciserTest.csproj", "{6E4116C9-9BEB-4FBA-B035-D91555E2C982}"
Expand Down
10 changes: 5 additions & 5 deletions ServerCodeExciser/ServerCodeExciser.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using ServerCodeExcisionCommon;
using Spectre.Console;
using Spectre.Console.Cli;
using System;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Text.Json;
using System.Text.Json.Serialization;
using ServerCodeExcisionCommon;
using Spectre.Console;
using Spectre.Console.Cli;
using UnrealAngelscriptServerCodeExcision;

namespace ServerCodeExciser
Expand Down Expand Up @@ -69,7 +69,7 @@ public sealed class Settings : CommandSettings
class RootPaths
{
[JsonPropertyName("AngelscriptScriptRoots")]
public string[] AngelscriptScriptRoots { get;set;} = Array.Empty<string>();
public string[] AngelscriptScriptRoots { get; set; } = Array.Empty<string>();
}

public override int Execute([NotNull] CommandContext context, [NotNull] Settings settings)
Expand All @@ -91,7 +91,7 @@ public override int Execute([NotNull] CommandContext context, [NotNull] Settings
var desc = File.ReadAllText(settings.InputPath);
var paths = JsonSerializer.Deserialize<RootPaths>(desc);
if (paths != null)
{
{
parameters.InputPaths.UnionWith(paths.AngelscriptScriptRoots);
}
else
Expand Down
4 changes: 2 additions & 2 deletions ServerCodeExciser/ServerCodeExcisionProcessor.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using Antlr4.Runtime;
using ServerCodeExcisionCommon;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Antlr4.Runtime;
using ServerCodeExcisionCommon;

namespace ServerCodeExciser
{
Expand Down
6 changes: 3 additions & 3 deletions ServerCodeExciserTest/ExcisionIntegrationTests.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using System.IO;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ServerCodeExciser;
using ServerCodeExcisionCommon;
using System;
using System.IO;
using UnrealAngelscriptServerCodeExcision;

[TestClass]
Expand Down Expand Up @@ -110,5 +110,5 @@ private static EExciserReturnValues RunExciserIntegrationTests(string fileExtens
}

return returnCode;
}
}
}
34 changes: 17 additions & 17 deletions ServerCodeExcisionCommon/IServerCodeExcisionLanguage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@

namespace ServerCodeExcisionCommon
{
public interface IServerCodeExcisionLanguage
{
List<string> ServerOnlySymbolRegexes { get; }
public interface IServerCodeExcisionLanguage
{
List<string> ServerOnlySymbolRegexes { get; }

List<string> ServerOnlySymbols { get; }
List<string> ServerOnlySymbols { get; }

string ServerPrecompilerSymbol { get; }
string ServerPrecompilerSymbol { get; }

string ServerScopeStartString { get; }
string ServerScopeStartString { get; }

string ServerScopeEndString { get; }
string ServerScopeEndString { get; }

T CreateLexer<T>(Antlr4.Runtime.AntlrInputStream inputStream)
where T : Antlr4.Runtime.Lexer;
T CreateLexer<T>(Antlr4.Runtime.AntlrInputStream inputStream)
where T : Antlr4.Runtime.Lexer;

T CreateParser<T>(Antlr4.Runtime.CommonTokenStream tokenStream)
where T : Antlr4.Runtime.Parser;
T CreateParser<T>(Antlr4.Runtime.CommonTokenStream tokenStream)
where T : Antlr4.Runtime.Parser;

IServerCodeVisitor CreateSimpleVisitor(string code);
IServerCodeVisitor CreateSimpleVisitor(string code);

IServerCodeVisitor CreateFunctionVisitor(string code);
IServerCodeVisitor CreateFunctionVisitor(string code);

IServerCodeVisitor CreateSymbolVisitor(string code);
IServerCodeVisitor CreateSymbolVisitor(string code);

bool AnyServerOnlySymbolsInScript(string script);
}
}
bool AnyServerOnlySymbolsInScript(string script);
}
}
40 changes: 20 additions & 20 deletions ServerCodeExcisionCommon/IServerCodeVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@

namespace ServerCodeExcisionCommon
{
public struct ServerOnlyScopeData
{
public int StartIndex;
public int StopIndex;
public string Opt_ElseContent;
public struct ServerOnlyScopeData
{
public int StartIndex;
public int StopIndex;
public string Opt_ElseContent;

public ServerOnlyScopeData(int startIndex, int stopIndex)
{
StartIndex = startIndex;
StopIndex = stopIndex;
Opt_ElseContent = "";
}
}
public ServerOnlyScopeData(int startIndex, int stopIndex)
{
StartIndex = startIndex;
StopIndex = stopIndex;
Opt_ElseContent = "";
}
}

public interface IServerCodeVisitor
{
List<ServerOnlyScopeData> DetectedServerOnlyScopes { get; }
Dictionary<int, HashSet<string>> ClassStartIdxDummyReferenceData { get; }
int TotalNumberOfFunctionCharactersVisited { get; }
public interface IServerCodeVisitor
{
List<ServerOnlyScopeData> DetectedServerOnlyScopes { get; }
Dictionary<int, HashSet<string>> ClassStartIdxDummyReferenceData { get; }
int TotalNumberOfFunctionCharactersVisited { get; }

void VisitContext(Antlr4.Runtime.Tree.IParseTree context);
}
}
void VisitContext(Antlr4.Runtime.Tree.IParseTree context);
}
}
Loading
Loading