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

Commit 65b6912

Browse files
committed
Support for file global variables and functions
1 parent 86ef00a commit 65b6912

File tree

5 files changed

+582
-298
lines changed

5 files changed

+582
-298
lines changed

SourcepawnCondenser/SourcepawnCondenser/Condenser.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ public partial class Condenser
1515
private readonly Token[] t;
1616
private int position;
1717

18-
public Condenser(string sourceCode, string fileName)
18+
public Condenser(string sourceCode, string fileName, bool isSP = false)
1919
{
2020
t = Tokenizer.Tokenizer.TokenizeString(sourceCode, true).ToArray();
2121
position = 0;
2222
length = t.Length;
23-
def = new SMDefinition();
23+
def = new SMDefinition(isSP);
2424
source = sourceCode;
2525
if (fileName.EndsWith(".inc", StringComparison.InvariantCultureIgnoreCase))
2626
fileName = fileName.Substring(0, fileName.Length - 4);
@@ -141,6 +141,12 @@ public SMDefinition Condense()
141141
position = newIndex + 1;
142142
continue;
143143
}
144+
newIndex = ConsumeSMFunction();
145+
if (newIndex != -1)
146+
{
147+
position = newIndex + 1;
148+
continue;
149+
}
144150
}
145151
break;
146152
}

0 commit comments

Comments
 (0)