Rename to StuLang
@ -1,5 +1,5 @@
|
||||
# Slang
|
||||
Slang, which stands for ***S****tupid **Lang**uage* is a custom programming language I made because I don't like c++ very much (Slang's interpreter is written in c++ though). Slang scripts have the file extension .slg. The base syntax and formatting I would say is quite similar to C#, but differs as task complexity increases. It has support for graphics using SDL2, and by default is not enabled. Here is some example code.
|
||||
# StuLang
|
||||
StuLang, which stands for ***Stu****pid **Lang**uage* is a custom programming language I made because I don't like c++ very much (StuLang's interpreter is written in c++ though). StuLang scripts have the file extension .slg. The base syntax and formatting I would say is quite similar to C#, but differs as task complexity increases. It has support for graphics using SDL2, and by default is not enabled. Here is some example code.
|
||||
```c#
|
||||
// Comments are indicated by two forward slashes
|
||||
// They can only be on their own line
|
||||
|
||||
|
Before Width: | Height: | Size: 802 B |
@ -3,7 +3,7 @@
|
||||
"VSVersion" = "3:800"
|
||||
"ProjectType" = "8:{978C614F-708E-4E1A-B201-565925725DBA}"
|
||||
"IsWebType" = "8:FALSE"
|
||||
"ProjectName" = "8:Slang-Installer"
|
||||
"ProjectName" = "8:StuLang-Installer"
|
||||
"LanguageId" = "3:1033"
|
||||
"CodePage" = "3:1252"
|
||||
"UILanguageId" = "3:1033"
|
||||
@ -231,24 +231,24 @@
|
||||
"Product"
|
||||
{
|
||||
"Name" = "8:Microsoft Visual Studio"
|
||||
"ProductName" = "8:Slang"
|
||||
"ProductCode" = "8:{506D3959-3D6F-4A4D-8F4C-E7A0F500EFDD}"
|
||||
"PackageCode" = "8:{F1C0D6B7-AD54-4E72-9BBC-F85826A6A3D7}"
|
||||
"ProductName" = "8:StuLang"
|
||||
"ProductCode" = "8:{73C5A50E-101B-40BC-BFD0-CF0BE1CA1034}"
|
||||
"PackageCode" = "8:{13B0CB72-D249-410A-BFF4-09C8B47D9696}"
|
||||
"UpgradeCode" = "8:{8ABDE53F-7FF9-455B-A777-B4C1C624FA13}"
|
||||
"AspNetVersion" = "8:2.0.50727.0"
|
||||
"RestartWWWService" = "11:FALSE"
|
||||
"RemovePreviousVersions" = "11:TRUE"
|
||||
"DetectNewerInstalledVersion" = "11:TRUE"
|
||||
"InstallAllUsers" = "11:FALSE"
|
||||
"ProductVersion" = "8:1.1.0"
|
||||
"ProductVersion" = "8:1.1.1"
|
||||
"Manufacturer" = "8:Sam-Astro"
|
||||
"ARPHELPTELEPHONE" = "8:"
|
||||
"ARPHELPLINK" = "8:"
|
||||
"Title" = "8:Slang"
|
||||
"Title" = "8:StuLang"
|
||||
"Subject" = "8:"
|
||||
"ARPCONTACT" = "8:Sam-Astro"
|
||||
"Keywords" = "8:"
|
||||
"ARPCOMMENTS" = "8:Installer for Slang interpreter"
|
||||
"ARPCOMMENTS" = "8:Installer for Stlang interpreter"
|
||||
"ARPURLINFOABOUT" = "8:"
|
||||
"ARPPRODUCTICON" = "8:"
|
||||
"ARPIconIndex" = "3:0"
|
||||
@ -754,7 +754,7 @@
|
||||
{
|
||||
"{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_AE404ABD11A04BF7AC95D60AB9EC740C"
|
||||
{
|
||||
"SourcePath" = "8:..\\Releases\\Slang\\Slang.exe"
|
||||
"SourcePath" = "8:..\\Releases\\StuLang\\StuLang.exe"
|
||||
"TargetName" = "8:"
|
||||
"Tag" = "8:"
|
||||
"Folder" = "8:_BCDF457FF4564F7BBFD6AEF054FE16C2"
|
||||
@ -562,7 +562,7 @@ boost::any ExecuteFunction(const string& functionName, const vector<boost::any>&
|
||||
return nullType;
|
||||
}
|
||||
|
||||
int parseSlang(string script)
|
||||
int parseStuLang(string script)
|
||||
{
|
||||
script = replace(script, " ", "\t");
|
||||
|
||||
@ -684,7 +684,7 @@ int main(int argc, char* argv[])
|
||||
|
||||
system("pause");
|
||||
|
||||
parseSlang(scriptString.str());
|
||||
parseStuLang(scriptString.str());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 93 B After Width: | Height: | Size: 93 B |
|
Before Width: | Height: | Size: 82 B After Width: | Height: | Size: 82 B |
@ -24,6 +24,7 @@
|
||||
<ProjectGuid>{d5f150f8-1f83-41eb-a195-1b5c3ca9322a}</ProjectGuid>
|
||||
<RootNamespace>Slang</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<ProjectName>StuLang</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
@ -69,7 +69,7 @@ int InterpreterLog(const string& logText)
|
||||
int Min = bt.tm_min;
|
||||
int Sec = bt.tm_sec;
|
||||
|
||||
cout << "\x1B[34m[" + to_string(Hour) + ":" + to_string(Min) + ":" + to_string(Sec) + "] \x1B[33mSlang: \x1B[32m" << logText << "\033[0m\t\t" << endl;
|
||||
cout << "\x1B[34m[" + to_string(Hour) + ":" + to_string(Min) + ":" + to_string(Sec) + "] \x1B[33mStuLang: \x1B[32m" << logText << "\033[0m\t\t" << endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -92,7 +92,7 @@ int LogCriticalError(const string& errorText)
|
||||
int Min = bt.tm_min;
|
||||
int Sec = bt.tm_sec;
|
||||
|
||||
cerr << "\x1B[34m[" + to_string(Hour) + ":" + to_string(Min) + ":" + to_string(Sec) + "] \x1B[33mSlang: \x1B[31mERROR: " << errorText << "\033[0m\t\t" << endl;
|
||||
cerr << "\x1B[34m[" + to_string(Hour) + ":" + to_string(Min) + ":" + to_string(Sec) + "] \x1B[33mStuLang: \x1B[31mERROR: " << errorText << "\033[0m\t\t" << endl;
|
||||
exit(EXIT_FAILURE);
|
||||
return 2;
|
||||
}
|
||||
@ -360,9 +360,6 @@ public:
|
||||
rect.y = static_cast<int>(position.y);
|
||||
rect.w = scale.x;
|
||||
rect.h = scale.y;
|
||||
// Centers
|
||||
rect.x = position.x - (rect.w / 2);
|
||||
rect.y = position.y - (rect.h / 2);
|
||||
|
||||
Load();
|
||||
}
|
||||
@ -387,9 +384,6 @@ public:
|
||||
int Draw()
|
||||
{
|
||||
SDL_RenderCopy(gRenderer, texture, NULL, &rect);
|
||||
// Centers
|
||||
rect.x = position.x - (rect.w / 2);
|
||||
rect.y = position.y - (rect.h / 2);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -541,7 +535,7 @@ public:
|
||||
|
||||
// Centers
|
||||
rect.x = position.x - (rect.w / 2);
|
||||
rect.y = position.y - (rect.h / 2);
|
||||
rect.y = rect.y - (rect.h / 2);
|
||||
|
||||
SDL_FreeSurface(surface);
|
||||
return 0;
|
||||
|
Before Width: | Height: | Size: 800 KiB After Width: | Height: | Size: 800 KiB |