Skip to content

Commit e0bc69c

Browse files
About to start working on package manager
1 parent e0d1658 commit e0bc69c

4 files changed

Lines changed: 15 additions & 30 deletions

File tree

EZCode.sln

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestEnv", "TestEnv\TestEnv.
99
EndProject
1010
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ez", "ez\ez.csproj", "{A9062E15-5201-47CC-917D-C210E41A1AEC}"
1111
EndProject
12-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinFormsEZCodeLibrary", "..\Packages\WinForms\WinFormsEZCodeLibrary\WinFormsEZCodeLibrary.csproj", "{E76392D5-986E-4434-9D50-9B24D1D148F5}"
13-
EndProject
1412
Global
1513
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1614
Debug|Any CPU = Debug|Any CPU
@@ -29,10 +27,6 @@ Global
2927
{A9062E15-5201-47CC-917D-C210E41A1AEC}.Debug|Any CPU.Build.0 = Debug|Any CPU
3028
{A9062E15-5201-47CC-917D-C210E41A1AEC}.Release|Any CPU.ActiveCfg = Release|Any CPU
3129
{A9062E15-5201-47CC-917D-C210E41A1AEC}.Release|Any CPU.Build.0 = Release|Any CPU
32-
{E76392D5-986E-4434-9D50-9B24D1D148F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33-
{E76392D5-986E-4434-9D50-9B24D1D148F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
34-
{E76392D5-986E-4434-9D50-9B24D1D148F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
35-
{E76392D5-986E-4434-9D50-9B24D1D148F5}.Release|Any CPU.Build.0 = Release|Any CPU
3630
EndGlobalSection
3731
GlobalSection(SolutionProperties) = preSolution
3832
HideSolutionNode = FALSE

EZCode/App.config

Lines changed: 0 additions & 8 deletions
This file was deleted.

TestEnv/Code.ezcode

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
include main
22

33
bool match new => regexmatch : hello, hi|hello
4-
5-
print 'match'
4+
print 'match'

ez/Program.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
using EZCodeLanguage;
2-
using System.IO;
32

4-
static class ez
3+
static class EZ
54
{
6-
public static int error_message = 0;
5+
public static int error_code = 0;
76
public static void Main(string[] args)
87
{
8+
99
if (args.Length == 0)
1010
{
1111
args = ["help"];
@@ -26,7 +26,7 @@ [FILEPATH] Runs file
2626
""");
2727
else
2828
{
29-
error_message = 1;
29+
error_code = 1;
3030
Console.WriteLine("Error, expected nothing after 'help' command");
3131
}
3232
break;
@@ -35,7 +35,7 @@ [FILEPATH] Runs file
3535
Console.WriteLine(Interpreter.Version);
3636
else
3737
{
38-
error_message = 1;
38+
error_code = 1;
3939
Console.WriteLine("Error, expected nothing after 'version' command");
4040
}
4141
break;
@@ -49,12 +49,12 @@ [FILEPATH] Runs file
4949
case "start":
5050
try
5151
{
52-
Environment();
52+
EZEnvironment();
5353
}
5454
catch (Exception e)
5555
{
5656
Console.WriteLine(e.Message);
57-
error_message = 1;
57+
error_code = 1;
5858
}
5959
break;
6060
default:
@@ -67,7 +67,7 @@ [FILEPATH] Runs file
6767
catch (Exception e)
6868
{
6969
Console.WriteLine(e.Message);
70-
error_message = 1;
70+
error_code = 1;
7171
break;
7272
}
7373
parser = new Parser(contents, path);
@@ -77,9 +77,9 @@ [FILEPATH] Runs file
7777
break;
7878
}
7979

80-
System.Environment.Exit(error_message);
80+
Environment.Exit(error_code);
8181
}
82-
static void Environment(string[] contents = null)
82+
static void EZEnvironment(string[] contents = null)
8383
{
8484
if (contents == null)
8585
{
@@ -100,7 +100,7 @@ static void Environment(string[] contents = null)
100100
string line = Console.ReadLine();
101101
if (line == "RUN")
102102
{
103-
Parser parser = new Parser(string.Join(System.Environment.NewLine, contents), AppDomain.CurrentDomain.BaseDirectory + "ez.exe");
103+
Parser parser = new Parser(string.Join(Environment.NewLine, contents), AppDomain.CurrentDomain.BaseDirectory + "ez.exe");
104104
parser = Package.ReturnParserWithPackages(parser, ["main"]);
105105
parser.Parse();
106106
Interpreter interpreter = new Interpreter(parser);
@@ -121,7 +121,7 @@ static void Environment(string[] contents = null)
121121
}
122122
else if (line == "LIST")
123123
{
124-
Console.WriteLine(string.Join(System.Environment.NewLine, contents));
124+
Console.WriteLine(string.Join(Environment.NewLine, contents));
125125
Console.WriteLine("LIST ENDED");
126126
continue;
127127
}
@@ -137,7 +137,7 @@ static void Environment(string[] contents = null)
137137
}
138138
contents = [.. contents, line];
139139
}
140-
if (again) Environment(contents);
141-
if (restart) Environment();
140+
if (again) EZEnvironment(contents);
141+
if (restart) EZEnvironment();
142142
}
143143
}

0 commit comments

Comments
 (0)