11using 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