Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit 98395b4

Browse files
committed
Squashed commit of the following:
commit 2df6eae Merge: 628d881 0b127b3 Author: Mattia <[email protected]> Date: Tue Mar 15 15:44:24 2022 +0100 Merge remote-tracking branch 'origin/ongoing' into ongoing commit 628d881 Author: Mattia <[email protected]> Date: Tue Mar 15 15:35:58 2022 +0100 AC support for enum structs commit 0b127b3 Author: Mattia <[email protected]> Date: Tue Mar 15 15:35:58 2022 +0100 AC support for methodmaps commit 6557a22 Author: Mattia <[email protected]> Date: Mon Mar 14 14:53:14 2022 +0100 Update Regex to match properly function/method calls. Removed atomic matching. commit 8720f08 Author: Maxi Jabase <[email protected]> Date: Fri Mar 11 23:59:39 2022 -0300 disable autocomplete force when selecting text commit 6f69691 Author: Mattia <[email protected]> Date: Thu Mar 10 23:25:17 2022 +0100 Fix build commit fbe1b5d Author: Mattia <[email protected]> Date: Thu Mar 10 23:23:32 2022 +0100 Rename ISNodes to Node commit 1f71e4f Author: Mattia <[email protected]> Date: Thu Mar 10 22:15:07 2022 +0100 Fix crash + Cleanup Methodmaps and Enum structs commit 86203b0 Author: Maxi Jabase <[email protected]> Date: Tue Mar 8 12:39:51 2022 -0300 options and search window UI improvements commit 4ccf373 Author: Maxi Jabase <[email protected]> Date: Tue Mar 8 11:19:48 2022 -0300 detail to last fix commit 124c32a Author: Maxi Jabase <[email protected]> Date: Tue Mar 8 03:48:11 2022 -0300 fixed instances where opened files would not get selected commit 311c37a Author: Maxi Jabase <[email protected]> Date: Tue Mar 8 03:36:36 2022 -0300 fixed dimming effect getting stuck in black sometimes commit 16bb5ee Merge: 341dfbc 9fc1b5a Author: Maxi Jabase <[email protected]> Date: Mon Mar 7 19:44:42 2022 -0300 Merge branch 'development' into ongoing commit 341dfbc Author: Maxi Jabase <[email protected]> Date: Mon Mar 7 19:44:10 2022 -0300 paths class cleanup commit 2339884 Merge: c926ec6 3d71913 Author: Maxi Jabase <[email protected]> Date: Mon Mar 7 01:15:47 2022 -0300 Merge branch 'development' into ongoing commit c926ec6 Author: Maxi Jabase <[email protected]> Date: Mon Mar 7 01:05:59 2022 -0300 added initial steps of RTL UI support commit 5ccbf53 Author: Maxi Jabase <[email protected]> Date: Sun Mar 6 22:10:54 2022 -0300 fixed changelog not working and added actual->new version indicator commit 650310d Author: Maxi Jabase <[email protected]> Date: Wed Mar 2 23:56:26 2022 -0300 fixed crash when closing 'select plugin to decompile' window commit 9efc67b Author: Maxi Jabase <[email protected]> Date: Wed Mar 2 12:17:01 2022 -0300 Squashed commit of the following: commit 08de973 Author: Maxi Jabase <[email protected]> Date: Wed Mar 2 01:29:50 2022 -0300 cleaned AboutWindow a bit (WIP) commit b80600f Author: Maxi Jabase <[email protected]> Date: Wed Mar 2 01:29:22 2022 -0300 remove all interpolated shit in translation strings commit dbea2fd Author: Maxi Jabase <[email protected]> Date: Tue Mar 1 21:18:55 2022 -0300 refactored the search window commit 70ecf63 Author: Maxi Jabase <[email protected]> Date: Tue Mar 1 21:18:39 2022 -0300 fixed a search setting not getting saved commit 59970f3 Author: Maxi Jabase <[email protected]> Date: Sat Feb 26 16:32:22 2022 -0300 added some titles, phrases and x:Name to grids commit 7e02048 Author: Maxi Jabase <[email protected]> Date: Sat Feb 26 15:55:57 2022 -0300 improved fallback method for missing phrases commit 7d1949b Author: Maxi Jabase <[email protected]> Date: Sat Feb 26 15:39:26 2022 -0300 added 'reload language' button next to language box in settings commit 24c318d Author: Maxi Jabase <[email protected]> Date: Sat Feb 26 15:39:09 2022 -0300 add more missing translations commit 6ce26e2 Author: Maxi Jabase <[email protected]> Date: Sat Feb 26 04:05:28 2022 -0300 fixed action on close box items translations commit 418face Author: Maxi Jabase <[email protected]> Date: Sat Feb 26 03:43:50 2022 -0300 fixed OB context menu items not being translated commit 8ead90a Author: Maxi Jabase <[email protected]> Date: Sat Feb 26 00:41:03 2022 -0300 add some missing translations commit 95b1843 Merge: 83b256d 3ec6ff5 Author: Maxi Jabase <[email protected]> Date: Fri Feb 25 17:50:23 2022 -0300 Merge branch 'ongoing' into translations-fixes commit 83b256d Merge: 28b3f69 3f30444 Author: Maxi Jabase <[email protected]> Date: Tue Feb 22 12:43:29 2022 -0300 Merge branch 'ongoing' into translations-fixes commit 28b3f69 Author: Maxi Jabase <[email protected]> Date: Sun Feb 20 16:17:34 2022 -0300 removed more hardcoded strings + added some phrases commit 3ec6ff5 Merge: 8dc4a43 3f30444 Author: Mattia <[email protected]> Date: Fri Feb 25 16:42:18 2022 +0100 Merge remote-tracking branch 'origin/ongoing' into ongoing commit 8dc4a43 Author: Mattia <[email protected]> Date: Fri Feb 25 16:42:13 2022 +0100 Better MethodMaps autocomplete commit 3f30444 Author: Maxi Jabase <[email protected]> Date: Tue Feb 22 12:43:03 2022 -0300 don't add XML comments to translations dictionary commit 8217db5 Author: Mattia <[email protected]> Date: Tue Feb 22 14:50:13 2022 +0100 Implement CTRL+SPACE to trigger the AC + ESC to close the tooltip commit 2bbb2cd Author: Mattia <[email protected]> Date: Sun Feb 20 14:27:44 2022 +0100 Fix methods AutoComplete + Implement parsing of included ".sp" files commit 058d8c8 Author: Maxi Jabase <[email protected]> Date: Sun Feb 20 01:21:15 2022 -0300 removed all hardcoded strings and if-default-dont-translate feature commit c8b6264 Author: Mattia <[email protected]> Date: Sat Feb 19 17:25:15 2022 +0100 Remove unused import commit 1286548 Author: Mattia <[email protected]> Date: Sat Feb 19 17:16:23 2022 +0100 Only show the methods of variable type commit 59f45ce Author: Mattia <[email protected]> Date: Sat Feb 19 13:42:27 2022 +0100 More IntelliSense cleanup commit b923823 Author: Mattia <[email protected]> Date: Sat Feb 19 00:54:24 2022 +0100 More IntelliSense cleanup commit 52dd22d Merge: f2c6e46 377041a Author: Maxi Jabase <[email protected]> Date: Fri Feb 18 13:46:35 2022 -0300 Merge branch 'ongoing' of https://github.com/SPCodeOrg/SPCode into ongoing commit 377041a Author: Mattia <[email protected]> Date: Fri Feb 18 16:43:28 2022 +0100 Clean up AutoComplete and IntelliSense commit f2c6e46 Merge: 3f9aa48 6696f0a Author: Maxi Jabase <[email protected]> Date: Thu Feb 17 17:22:28 2022 -0300 Merge branch 'ongoing' of https://github.com/SPCodeOrg/SPCode into ongoing commit 6696f0a Author: Mattia <[email protected]> Date: Thu Feb 17 18:33:25 2022 +0100 Fix preprocessor autocomplete commit 3f9aa48 Author: Maxi Jabase <[email protected]> Date: Thu Feb 17 11:03:19 2022 -0300 fixed close lower grid button missing commit 359762e Author: Mattia <[email protected]> Date: Thu Feb 17 13:37:01 2022 +0100 Better naming commit 552aa15 Merge: 78bb2b5 815577d Author: Mattia <[email protected]> Date: Thu Feb 17 13:31:03 2022 +0100 Merge remote-tracking branch 'origin/ongoing' into ongoing commit 78bb2b5 Author: Mattia <[email protected]> Date: Thu Feb 17 13:30:56 2022 +0100 Implement PreProcessor statements auto-complete commit 815577d Author: Maxi Jabase <[email protected]> Date: Thu Feb 17 01:50:56 2022 -0300 add highlighting to keyword 'operator' commit c960925 Author: Mattia <[email protected]> Date: Thu Feb 17 02:24:00 2022 +0100 Minor cleanup commit ed070bc Author: Maxi Jabase <[email protected]> Date: Wed Feb 16 22:09:34 2022 -0300 improved exception handling when parsing translations commit 48adf8e Author: Mattia <[email protected]> Date: Thu Feb 17 01:55:46 2022 +0100 Implement enum struct highlighting + Auto-complete for local variables commit ccc6c14 Author: Mattia <[email protected]> Date: Wed Feb 16 22:19:02 2022 +0100 Merge SearchBoxTextChanged function
1 parent 9fc1b5a commit 98395b4

36 files changed

+429
-483
lines changed

Interop/ConfigControl.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ namespace SPCode.Interop
1010
{
1111
public static class ConfigLoader
1212
{
13-
public static Config[] Load()
13+
public static List<Config> Load()
1414
{
1515
var configs = new List<Config>();
16-
if (File.Exists(Paths.GetConfigFilePath()))
16+
if (File.Exists(PathsHelper.ConfigFilePath))
1717
{
1818
try
1919
{
2020
// Document gets loaded
2121
var document = new XmlDocument();
22-
document.Load(Paths.GetConfigFilePath());
22+
document.Load(PathsHelper.ConfigFilePath);
2323

2424
// Document gets checked for proper Configurations tag
2525
if (document.ChildNodes.Count < 1)
@@ -63,7 +63,7 @@ public static Config[] Load()
6363
// (calculate it based on installation being standalone or portable)
6464
if (IsStandardConfig && string.IsNullOrEmpty(_SMDirectoryStr))
6565
{
66-
SMDirs.Add(Paths.GetConfigsDirectory());
66+
SMDirs.Add(PathsHelper.ConfigsDirectory);
6767
}
6868

6969
foreach (var dir in SMDirectoriesSplitted)
@@ -78,7 +78,7 @@ public static Config[] Load()
7878
// Extra assurance for the program to always load a proper config
7979
if (IsStandardConfig && SMDirs.Count == 0)
8080
{
81-
SMDirs.Add(Paths.GetConfigsDirectory());
81+
SMDirs.Add(PathsHelper.ConfigsDirectory);
8282
}
8383

8484
int _OptimizationLevel = 2, _VerboseLevel = 1;
@@ -169,7 +169,7 @@ public static Config[] Load()
169169
Environment.Exit(Environment.ExitCode);
170170
}
171171

172-
return configs.ToArray();
172+
return configs;
173173
}
174174

175175
private static string ReadAttributeStringSafe(ref XmlNode node, string attributeName, string defaultValue = "")

Interop/OptionsControl.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ public static void Save()
229229
try
230230
{
231231
var formatter = new BinaryFormatter();
232-
using var fileStream = new FileStream(Paths.GetOptionsFilePath(), FileMode.Create, FileAccess.ReadWrite,
232+
using var fileStream = new FileStream(PathsHelper.OptionsFilePath, FileMode.Create, FileAccess.ReadWrite,
233233
FileShare.None);
234234
formatter.Serialize(fileStream, Program.OptionsObject);
235235
}
@@ -242,11 +242,11 @@ public static OptionsControl Load(out bool ProgramIsNew)
242242
{
243243
try
244244
{
245-
if (File.Exists(Paths.GetOptionsFilePath()))
245+
if (File.Exists(PathsHelper.OptionsFilePath))
246246
{
247247
OptionsControl optionsObject;
248248
var formatter = new BinaryFormatter();
249-
using (var fileStream = new FileStream(Paths.GetOptionsFilePath(), FileMode.Open, FileAccess.Read,
249+
using (var fileStream = new FileStream(PathsHelper.OptionsFilePath, FileMode.Open, FileAccess.Read,
250250
FileShare.ReadWrite))
251251
{
252252
optionsObject = (OptionsControl)formatter.Deserialize(fileStream);

Interop/PipeInteropServer.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ private void PipeConnection_MessageIn(IAsyncResult iar)
5959
{
6060
if (_window.IsLoaded)
6161
{
62-
if (_window.TryLoadSourceFile(files[i], out _, SelectIt) && _window.WindowState == System.Windows.WindowState.Minimized)
62+
if (_window.TryLoadSourceFile(files[i], out _, SelectMe: SelectIt) && _window.WindowState == System.Windows.WindowState.Minimized)
6363
{
6464
_window.WindowState = System.Windows.WindowState.Normal;
6565
SelectIt = false;

Interop/TranslationProvider.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public class TranslationProvider
1616
public List<string> AvailableLanguageIDs = new();
1717
public List<string> AvailableLanguages = new();
1818

19-
private readonly string _tempDir = Paths.GetTempDirectory();
20-
private readonly string _translationsDir = Paths.GetTranslationsDirectory();
19+
private readonly string _tempDir = PathsHelper.TempDirectory;
20+
private readonly string _translationsDir = PathsHelper.TranslationsDirectory;
2121
private static readonly Dictionary<string, string> _langDictionary = new(StringComparer.OrdinalIgnoreCase);
2222
private static readonly Dictionary<string, string> _defaultDictionary = new(StringComparer.OrdinalIgnoreCase);
2323
private Release _latestVersion;

Program.cs

+9-10
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static class Program
2828
public static OptionsControl OptionsObject;
2929
public static TranslationProvider Translations;
3030
public static List<HotkeyInfo> HotkeysList;
31-
public static Config[] Configs;
31+
public static List<Config> Configs;
3232
public static int SelectedConfig;
3333
public static string SelectedTemplatePath;
3434
public static Stack<string> RecentFilesStack = new();
@@ -43,8 +43,6 @@ public static class Program
4343
? new string(' ', OptionsObject.Editor_IndentationSize)
4444
: "\t";
4545

46-
public static bool _IsLocalInstallation;
47-
4846
[STAThread]
4947
public static void Main(string[] args)
5048
{
@@ -65,7 +63,6 @@ public static void Main(string[] args)
6563
ProfileOptimization.SetProfileRoot(Environment.CurrentDirectory);
6664
ProfileOptimization.StartProfile("Startup.Profile");
6765
#endif
68-
_IsLocalInstallation = Paths.IsLocalInstallation();
6966
UpdateStatus = new UpdateInfo();
7067
OptionsObject = OptionsControl.Load(out var ProgramIsNew);
7168

@@ -117,7 +114,7 @@ public static void Main(string[] args)
117114
}
118115

119116
Configs = ConfigLoader.Load();
120-
for (var i = 0; i < Configs.Length; ++i)
117+
for (var i = 0; i < Configs.Count; ++i)
121118
{
122119
if (Configs[i].Name == OptionsObject.Program_SelectedConfig)
123120
{
@@ -158,11 +155,12 @@ public static void Main(string[] args)
158155
}
159156
catch (Exception e)
160157
{
161-
File.WriteAllText($@"{Paths.GetCrashLogDirectory()}\CRASH_{Environment.TickCount}.txt",
158+
var crashDir = PathsHelper.CrashLogDirectory;
159+
File.WriteAllText($@"{crashDir}\CRASH_{Environment.TickCount}.txt",
162160
BuildExceptionString(e, "SPCODE LOADING"));
163161
MessageBox.Show(
164162
"An error occured." + Environment.NewLine +
165-
$"A crash report was written in {Paths.GetCrashLogDirectory()}",
163+
$"A crash report was written in {crashDir}",
166164
"Error",
167165
MessageBoxButton.OK,
168166
MessageBoxImage.Error);
@@ -185,11 +183,12 @@ public static void Main(string[] args)
185183
}
186184
catch (Exception e)
187185
{
188-
File.WriteAllText($@"{Paths.GetCrashLogDirectory()}\CRASH_{Environment.TickCount}.txt",
186+
var crashDir = PathsHelper.CrashLogDirectory;
187+
File.WriteAllText($@"{crashDir}\CRASH_{Environment.TickCount}.txt",
189188
BuildExceptionString(e, "SPCODE MAIN"));
190189
MessageBox.Show(
191190
"An error occured." + Environment.NewLine +
192-
$"A crash report was written in {Paths.GetCrashLogDirectory()}",
191+
$"A crash report was written in {crashDir}",
193192
"Error",
194193
MessageBoxButton.OK,
195194
MessageBoxImage.Error);
@@ -277,7 +276,7 @@ private static string BuildExceptionString(Exception e, string SectionName)
277276
var outString = new StringBuilder();
278277
outString.AppendLine("Section: " + SectionName);
279278
outString.AppendLine(".NET Version: " + Environment.Version);
280-
outString.AppendLine("Is local installation?: " + _IsLocalInstallation);
279+
outString.AppendLine("Is local installation?: " + PathsHelper.LocalInstallation);
281280
outString.AppendLine("OS: " + Environment.OSVersion.VersionString);
282281
outString.AppendLine("64 bit OS: " + (Environment.Is64BitOperatingSystem ? "TRUE" : "FALSE"));
283282
outString.AppendLine("64 bit mode: " + (Environment.Is64BitProcess ? "TRUE" : "FALSE"));

SourcepawnCondenser/CondenserTest/MainWindow.xaml.cs

+3-13
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
145145
item.MouseLeftButtonUp += ItemMM_MouseLeftButtonUp;
146146
item.Items.Add(new TreeViewItem() { Header = "Index: " + m.Index, Background = Brushes.LightGray });
147147
item.Items.Add(new TreeViewItem() { Header = "Length: " + m.Length });
148-
item.Items.Add(new TreeViewItem() { Header = "Type: " + m.Type, Background = Brushes.LightGray });
149148
item.Items.Add(new TreeViewItem() { Header = "InheritedType: " + m.InheritedType });
150149
var subItem = new TreeViewItem() { Header = "Methods", Background = Brushes.LightGray };
151150
for (var j = 0; j < m.Methods.Count; ++j)
@@ -155,16 +154,6 @@ private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
155154
subSubItem.Items.Add(new TreeViewItem() { Header = "Length: " + m.Methods[j].Length, Background = Brushes.LightGray });
156155
subSubItem.Items.Add(new TreeViewItem() { Header = "Comment: >>" + m.Methods[j].CommentString + "<<" });
157156
subSubItem.Items.Add(new TreeViewItem() { Header = "Return: " + m.Methods[j].ReturnType, Background = Brushes.LightGray });
158-
var k = 0;
159-
for (; k < m.Methods[j].MethodKind.Length; ++k)
160-
{
161-
subSubItem.Items.Add(new TreeViewItem() { Header = "MethodKind" + (k + 1) + ": " + m.Methods[j].MethodKind[k], Background = (k % 2 == 0) ? Brushes.LightGray : Brushes.White });
162-
}
163-
for (var l = 0; l < m.Methods[j].Parameters.Length; ++l)
164-
{
165-
++k;
166-
subSubItem.Items.Add(new TreeViewItem() { Header = "Parameter" + (l + 1) + ": " + m.Methods[j].Parameters[l], Background = (k % 2 == 0) ? Brushes.LightGray : Brushes.White });
167-
}
168157
subItem.Items.Add(subSubItem);
169158
}
170159
item.Items.Add(subItem);
@@ -199,11 +188,12 @@ private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
199188
subSubItem.Items.Add(new TreeViewItem() { Header = "Length: " + m.Methods[j].Length, Background = Brushes.LightGray });
200189
subSubItem.Items.Add(new TreeViewItem() { Header = "Comment: >>" + m.Methods[j].CommentString + "<<" });
201190
subSubItem.Items.Add(new TreeViewItem() { Header = "Return: " + m.Methods[j].ReturnType, Background = Brushes.LightGray });
202-
var k = 0;
191+
192+
var k = 0;/*
203193
for (; k < m.Methods[j].MethodKind.Length; ++k)
204194
{
205195
subSubItem.Items.Add(new TreeViewItem() { Header = "MethodKind" + (k + 1) + ": " + m.Methods[j].MethodKind[k], Background = (k % 2 == 0) ? Brushes.LightGray : Brushes.White });
206-
}
196+
}*/
207197
for (var l = 0; l < m.Methods[j].Parameters.Length; ++l)
208198
{
209199
++k;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using SourcepawnCondenser.SourcemodDefinition;
5+
6+
namespace SourcepawnCondenser;
7+
8+
9+
/// <summary>
10+
/// This is inherited from from SMMethodmap and SMEnumStruct
11+
/// </summary>
12+
public abstract class SMClasslike : SMBaseDefinition
13+
{
14+
public readonly List<SMObjectField> Fields = new();
15+
public readonly List<SMObjectMethod> Methods = new();
16+
17+
public List<ACNode> ProduceNodes()
18+
{
19+
var nodes = new List<ACNode>();
20+
nodes.AddRange(ACNode.ConvertFromStringList(Methods.Select(e => e.Name), true, "▲ "));
21+
nodes.AddRange(ACNode.ConvertFromStringList(Fields.Select(e => e.Name), false, "• "));
22+
23+
nodes.Sort((a, b) => string.CompareOrdinal(a.EntryName, b.EntryName));
24+
25+
return nodes;
26+
}
27+
}
28+
29+
public abstract class SMObjectMethod : SMBaseDefinition
30+
{
31+
public string ClassName = string.Empty;
32+
public string FullName = string.Empty;
33+
public string ReturnType = string.Empty;
34+
public string[] Parameters = Array.Empty<string>();
35+
}
36+
37+
public abstract class SMObjectField : SMBaseDefinition
38+
{
39+
public string ClassName = string.Empty;
40+
public string FullName = string.Empty;
41+
}

SourcepawnCondenser/SourcepawnCondenser/CondenserFunctions/SMEnumStructConsumer.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,12 @@ private int ConsumeSMEnumStruct()
203203
Index = mStartIndex,
204204
Name = methodName,
205205
ReturnType = methodReturnValue,
206-
MethodKind = functionIndicators.ToArray(),
206+
// MethodKind = functionIndicators.ToArray(),
207207
Parameters = parameters.ToArray(),
208208
FullName = TrimFullname(source.Substring(mStartIndex, mEndIndex - mStartIndex + 1)),
209209
Length = mEndIndex - mStartIndex + 1,
210210
CommentString = TrimComments(functionCommentString),
211-
MethodmapName = enumStructName,
211+
// MethodmapName = enumStructName,
212212
File = FileName
213213
});
214214
}

SourcepawnCondenser/SourcepawnCondenser/CondenserFunctions/SMMethodmapConsumer.cs

+11-16
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,16 @@ private int ConsumeSMMethodmap()
1515
if ((position + 4) < length)
1616
{
1717
var methodMapName = string.Empty;
18-
var methodMapType = string.Empty;
1918
var methods = new List<SMMethodmapMethod>();
2019
var fields = new List<SMMethodmapField>();
2120
if (t[iteratePosition].Kind == TokenKind.Identifier)
2221
{
22+
methodMapName = t[iteratePosition].Value;
23+
24+
// Handle declaration like "methodmap MyMap __nullable { ... }"
2325
if (t[iteratePosition + 1].Kind == TokenKind.Identifier)
2426
{
25-
methodMapType = t[iteratePosition].Value;
2627
++iteratePosition;
27-
methodMapName = t[iteratePosition].Value;
28-
}
29-
else
30-
{
31-
methodMapName = t[iteratePosition].Value;
3228
}
3329
++iteratePosition;
3430
}
@@ -97,7 +93,7 @@ private int ConsumeSMMethodmap()
9793
var functionIndicators = new List<string>();
9894
var parameters = new List<string>();
9995
var methodName = string.Empty;
100-
var methodReturnValue = string.Empty;
96+
var methodReturnType = string.Empty;
10197
var ParsingIndicators = true;
10298
var InCodeSection = false;
10399
var ParenthesisIndex = 0;
@@ -144,7 +140,7 @@ private int ConsumeSMMethodmap()
144140
{
145141
if (t[i + 1].Kind == TokenKind.Identifier)
146142
{
147-
methodReturnValue = t[i].Value;
143+
methodReturnType = t[i].Value;
148144
methodName = t[i + 1].Value;
149145
++i;
150146
}
@@ -210,13 +206,13 @@ private int ConsumeSMMethodmap()
210206
{
211207
Index = mStartIndex,
212208
Name = methodName,
213-
ReturnType = methodReturnValue,
214-
MethodKind = functionIndicators.ToArray(),
215-
Parameters = parameters.ToArray(),
209+
ReturnType = methodReturnType,
210+
/*MethodKind = functionIndicators.ToArray(),
211+
Parameters = parameters.ToArray(),*/
216212
FullName = TrimFullname(source.Substring(mStartIndex, mEndIndex - mStartIndex + 1)),
217213
Length = mEndIndex - mStartIndex + 1,
218214
CommentString = TrimComments(functionCommentString),
219-
MethodmapName = methodMapName,
215+
ClassName = methodMapName,
220216
File = FileName
221217
});
222218
}
@@ -287,13 +283,13 @@ private int ConsumeSMMethodmap()
287283
}
288284
if (fStartIndex < fEndIndex)
289285
{
290-
fields.Add(new SMMethodmapField()
286+
fields.Add(new SMMethodmapField
291287
{
292288
Index = fStartIndex,
293289
Length = fEndIndex - fStartIndex + 1,
294290
Name = fieldName,
295291
File = FileName,
296-
MethodmapName = methodMapName,
292+
ClassName = methodMapName,
297293
FullName = source.Substring(fStartIndex, fEndIndex - fStartIndex + 1)
298294
});
299295
}
@@ -308,7 +304,6 @@ private int ConsumeSMMethodmap()
308304
Length = t[lastIndex].Index - startIndex + 1,
309305
Name = methodMapName,
310306
File = FileName,
311-
Type = methodMapType,
312307
InheritedType = inheriteType
313308
};
314309
mm.Methods.AddRange(methods);
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
namespace SourcepawnCondenser.SourcemodDefinition
1+
namespace SourcepawnCondenser.SourcemodDefinition;
2+
3+
abstract public class SMBaseDefinition
24
{
3-
public class SMBaseDefinition
4-
{
5-
public int Index = -1;
6-
public int Length = 0;
7-
public string File = string.Empty;
5+
public int Index = -1;
6+
public int Length = 0;
7+
public string File = string.Empty;
88

9-
public string Name = string.Empty;
10-
public string CommentString = string.Empty;
11-
}
9+
public string Name = string.Empty;
10+
public string CommentString = string.Empty;
1211
}

0 commit comments

Comments
 (0)