Rename to StuLang
@ -1,5 +1,5 @@
|
|||||||
# Slang
|
# StuLang
|
||||||
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, 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#
|
```c#
|
||||||
// Comments are indicated by two forward slashes
|
// Comments are indicated by two forward slashes
|
||||||
// They can only be on their own line
|
// They can only be on their own line
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 802 B |
@ -3,7 +3,7 @@
|
|||||||
"VSVersion" = "3:800"
|
"VSVersion" = "3:800"
|
||||||
"ProjectType" = "8:{978C614F-708E-4E1A-B201-565925725DBA}"
|
"ProjectType" = "8:{978C614F-708E-4E1A-B201-565925725DBA}"
|
||||||
"IsWebType" = "8:FALSE"
|
"IsWebType" = "8:FALSE"
|
||||||
"ProjectName" = "8:Slang-Installer"
|
"ProjectName" = "8:StuLang-Installer"
|
||||||
"LanguageId" = "3:1033"
|
"LanguageId" = "3:1033"
|
||||||
"CodePage" = "3:1252"
|
"CodePage" = "3:1252"
|
||||||
"UILanguageId" = "3:1033"
|
"UILanguageId" = "3:1033"
|
||||||
@ -231,24 +231,24 @@
|
|||||||
"Product"
|
"Product"
|
||||||
{
|
{
|
||||||
"Name" = "8:Microsoft Visual Studio"
|
"Name" = "8:Microsoft Visual Studio"
|
||||||
"ProductName" = "8:Slang"
|
"ProductName" = "8:StuLang"
|
||||||
"ProductCode" = "8:{506D3959-3D6F-4A4D-8F4C-E7A0F500EFDD}"
|
"ProductCode" = "8:{73C5A50E-101B-40BC-BFD0-CF0BE1CA1034}"
|
||||||
"PackageCode" = "8:{F1C0D6B7-AD54-4E72-9BBC-F85826A6A3D7}"
|
"PackageCode" = "8:{13B0CB72-D249-410A-BFF4-09C8B47D9696}"
|
||||||
"UpgradeCode" = "8:{8ABDE53F-7FF9-455B-A777-B4C1C624FA13}"
|
"UpgradeCode" = "8:{8ABDE53F-7FF9-455B-A777-B4C1C624FA13}"
|
||||||
"AspNetVersion" = "8:2.0.50727.0"
|
"AspNetVersion" = "8:2.0.50727.0"
|
||||||
"RestartWWWService" = "11:FALSE"
|
"RestartWWWService" = "11:FALSE"
|
||||||
"RemovePreviousVersions" = "11:TRUE"
|
"RemovePreviousVersions" = "11:TRUE"
|
||||||
"DetectNewerInstalledVersion" = "11:TRUE"
|
"DetectNewerInstalledVersion" = "11:TRUE"
|
||||||
"InstallAllUsers" = "11:FALSE"
|
"InstallAllUsers" = "11:FALSE"
|
||||||
"ProductVersion" = "8:1.1.0"
|
"ProductVersion" = "8:1.1.1"
|
||||||
"Manufacturer" = "8:Sam-Astro"
|
"Manufacturer" = "8:Sam-Astro"
|
||||||
"ARPHELPTELEPHONE" = "8:"
|
"ARPHELPTELEPHONE" = "8:"
|
||||||
"ARPHELPLINK" = "8:"
|
"ARPHELPLINK" = "8:"
|
||||||
"Title" = "8:Slang"
|
"Title" = "8:StuLang"
|
||||||
"Subject" = "8:"
|
"Subject" = "8:"
|
||||||
"ARPCONTACT" = "8:Sam-Astro"
|
"ARPCONTACT" = "8:Sam-Astro"
|
||||||
"Keywords" = "8:"
|
"Keywords" = "8:"
|
||||||
"ARPCOMMENTS" = "8:Installer for Slang interpreter"
|
"ARPCOMMENTS" = "8:Installer for Stlang interpreter"
|
||||||
"ARPURLINFOABOUT" = "8:"
|
"ARPURLINFOABOUT" = "8:"
|
||||||
"ARPPRODUCTICON" = "8:"
|
"ARPPRODUCTICON" = "8:"
|
||||||
"ARPIconIndex" = "3:0"
|
"ARPIconIndex" = "3:0"
|
||||||
@ -754,7 +754,7 @@
|
|||||||
{
|
{
|
||||||
"{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_AE404ABD11A04BF7AC95D60AB9EC740C"
|
"{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_AE404ABD11A04BF7AC95D60AB9EC740C"
|
||||||
{
|
{
|
||||||
"SourcePath" = "8:..\\Releases\\Slang\\Slang.exe"
|
"SourcePath" = "8:..\\Releases\\StuLang\\StuLang.exe"
|
||||||
"TargetName" = "8:"
|
"TargetName" = "8:"
|
||||||
"Tag" = "8:"
|
"Tag" = "8:"
|
||||||
"Folder" = "8:_BCDF457FF4564F7BBFD6AEF054FE16C2"
|
"Folder" = "8:_BCDF457FF4564F7BBFD6AEF054FE16C2"
|
||||||
@ -562,7 +562,7 @@ boost::any ExecuteFunction(const string& functionName, const vector<boost::any>&
|
|||||||
return nullType;
|
return nullType;
|
||||||
}
|
}
|
||||||
|
|
||||||
int parseSlang(string script)
|
int parseStuLang(string script)
|
||||||
{
|
{
|
||||||
script = replace(script, " ", "\t");
|
script = replace(script, " ", "\t");
|
||||||
|
|
||||||
@ -684,7 +684,7 @@ int main(int argc, char* argv[])
|
|||||||
|
|
||||||
system("pause");
|
system("pause");
|
||||||
|
|
||||||
parseSlang(scriptString.str());
|
parseStuLang(scriptString.str());
|
||||||
|
|
||||||
return 0;
|
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>
|
<ProjectGuid>{d5f150f8-1f83-41eb-a195-1b5c3ca9322a}</ProjectGuid>
|
||||||
<RootNamespace>Slang</RootNamespace>
|
<RootNamespace>Slang</RootNamespace>
|
||||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||||
|
<ProjectName>StuLang</ProjectName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
@ -69,7 +69,7 @@ int InterpreterLog(const string& logText)
|
|||||||
int Min = bt.tm_min;
|
int Min = bt.tm_min;
|
||||||
int Sec = bt.tm_sec;
|
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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ int LogCriticalError(const string& errorText)
|
|||||||
int Min = bt.tm_min;
|
int Min = bt.tm_min;
|
||||||
int Sec = bt.tm_sec;
|
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);
|
exit(EXIT_FAILURE);
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
@ -360,9 +360,6 @@ public:
|
|||||||
rect.y = static_cast<int>(position.y);
|
rect.y = static_cast<int>(position.y);
|
||||||
rect.w = scale.x;
|
rect.w = scale.x;
|
||||||
rect.h = scale.y;
|
rect.h = scale.y;
|
||||||
// Centers
|
|
||||||
rect.x = position.x - (rect.w / 2);
|
|
||||||
rect.y = position.y - (rect.h / 2);
|
|
||||||
|
|
||||||
Load();
|
Load();
|
||||||
}
|
}
|
||||||
@ -387,9 +384,6 @@ public:
|
|||||||
int Draw()
|
int Draw()
|
||||||
{
|
{
|
||||||
SDL_RenderCopy(gRenderer, texture, NULL, &rect);
|
SDL_RenderCopy(gRenderer, texture, NULL, &rect);
|
||||||
// Centers
|
|
||||||
rect.x = position.x - (rect.w / 2);
|
|
||||||
rect.y = position.y - (rect.h / 2);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -541,7 +535,7 @@ public:
|
|||||||
|
|
||||||
// Centers
|
// Centers
|
||||||
rect.x = position.x - (rect.w / 2);
|
rect.x = position.x - (rect.w / 2);
|
||||||
rect.y = position.y - (rect.h / 2);
|
rect.y = rect.y - (rect.h / 2);
|
||||||
|
|
||||||
SDL_FreeSurface(surface);
|
SDL_FreeSurface(surface);
|
||||||
return 0;
|
return 0;
|
||||||
|
Before Width: | Height: | Size: 800 KiB After Width: | Height: | Size: 800 KiB |