Browse Source

Sol Part 49: All Aboard The Failed Build Train!

Graham Northup 5 years ago
parent
commit
77e0861509
Signed by: Grissess <grissess@nexusg.org> GPG Key ID: 5D000E6F539376FB
4 changed files with 78 additions and 73 deletions
  1. 20
    2
      .gitlab-ci.yml
  2. 2
    2
      Makefile
  3. 50
    65
      lex.yy.c
  4. 6
    4
      solrun.c

+ 20
- 2
.gitlab-ci.yml View File

@@ -1,2 +1,20 @@
1
-job make:
2
-    script: "make"
1
+stages:
2
+    - build
3
+    - test
4
+
5
+build:
6
+    stage: build
7
+    script:
8
+        - make
9
+
10
+run:
11
+    stage: test
12
+    script:
13
+        - make
14
+        - echo "exit()" | ./sol r programs/interp.sol
15
+
16
+test:
17
+    stage: test
18
+    script:
19
+        - make
20
+        - ./sol r program/test.sol

+ 2
- 2
Makefile View File

@@ -4,7 +4,7 @@ OBJ= lex.yy.o parser.tab.o dsl/seq.o dsl/list.o dsl/array.o dsl/generic.o astpri
4 4
 
5 5
 all: $(OBJ)
6 6
 	git submodule init && git submodule sync && git submodule update
7
-	gcc $(CFLAGS) $? $(LDFLAGS) -o solace
7
+	gcc $(CFLAGS) $? $(LDFLAGS) -o sol
8 8
 
9 9
 %.o: %.c
10 10
 	gcc -c -o $@ $? $(CFLAGS)
@@ -16,7 +16,7 @@ lex.yy.c: tokenizer.lex parser.tab.h
16 16
 	flex $<
17 17
 
18 18
 clean:
19
-	rm -f *.o dsl/*.o solace
19
+	rm -f *.o dsl/*.o sol
20 20
 
21 21
 docs: Doxyfile 
22 22
 	doxygen Doxyfile

+ 50
- 65
lex.yy.c View File

@@ -8,7 +8,7 @@
8 8
 #define FLEX_SCANNER
9 9
 #define YY_FLEX_MAJOR_VERSION 2
10 10
 #define YY_FLEX_MINOR_VERSION 6
11
-#define YY_FLEX_SUBMINOR_VERSION 0
11
+#define YY_FLEX_SUBMINOR_VERSION 1
12 12
 #if YY_FLEX_SUBMINOR_VERSION > 0
13 13
 #define FLEX_BETA
14 14
 #endif
@@ -87,25 +87,13 @@ typedef unsigned int flex_uint32_t;
87 87
 
88 88
 #endif /* ! FLEXINT_H */
89 89
 
90
-#ifdef __cplusplus
91
-
92
-/* The "const" storage-class-modifier is valid. */
93
-#define YY_USE_CONST
94
-
95
-#else	/* ! __cplusplus */
96
-
97
-/* C99 requires __STDC__ to be defined as 1. */
98
-#if defined (__STDC__)
99
-
100
-#define YY_USE_CONST
101
-
102
-#endif	/* defined (__STDC__) */
103
-#endif	/* ! __cplusplus */
104
-
105
-#ifdef YY_USE_CONST
90
+/* TODO: this is always defined, so inline it */
106 91
 #define yyconst const
92
+
93
+#if defined(__GNUC__) && __GNUC__ >= 3
94
+#define yynoreturn __attribute__((__noreturn__))
107 95
 #else
108
-#define yyconst
96
+#define yynoreturn
109 97
 #endif
110 98
 
111 99
 /* Returned upon end-of-file. */
@@ -166,7 +154,7 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
166 154
 typedef size_t yy_size_t;
167 155
 #endif
168 156
 
169
-extern yy_size_t yyleng;
157
+extern int yyleng;
170 158
 
171 159
 extern FILE *yyin, *yyout;
172 160
 
@@ -205,12 +193,12 @@ struct yy_buffer_state
205 193
 	/* Size of input buffer in bytes, not including room for EOB
206 194
 	 * characters.
207 195
 	 */
208
-	yy_size_t yy_buf_size;
196
+	int yy_buf_size;
209 197
 
210 198
 	/* Number of characters read into yy_ch_buf, not including EOB
211 199
 	 * characters.
212 200
 	 */
213
-	yy_size_t yy_n_chars;
201
+	int yy_n_chars;
214 202
 
215 203
 	/* Whether we "own" the buffer - i.e., we know we created it,
216 204
 	 * and can realloc() it to grow it, and should free() it to
@@ -261,7 +249,7 @@ struct yy_buffer_state
261 249
 /* Stack of input buffers. */
262 250
 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
263 251
 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
264
-static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
252
+static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
265 253
 
266 254
 /* We provide macros for accessing buffer states in case in the
267 255
  * future we want to put the buffer states in a more general
@@ -280,11 +268,11 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
280 268
 
281 269
 /* yy_hold_char holds the character lost when yytext is formed. */
282 270
 static char yy_hold_char;
283
-static yy_size_t yy_n_chars;		/* number of characters read into yy_ch_buf */
284
-yy_size_t yyleng;
271
+static int yy_n_chars;		/* number of characters read into yy_ch_buf */
272
+int yyleng;
285 273
 
286 274
 /* Points to current character in buffer. */
287
-static char *yy_c_buf_p = (char *) 0;
275
+static char *yy_c_buf_p = NULL;
288 276
 static int yy_init = 0;		/* whether we need to initialize */
289 277
 static int yy_start = 0;	/* start state number */
290 278
 
@@ -309,7 +297,7 @@ static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
309 297
 
310 298
 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  );
311 299
 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  );
312
-YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len  );
300
+YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len  );
313 301
 
314 302
 void *yyalloc (yy_size_t  );
315 303
 void *yyrealloc (void *,yy_size_t  );
@@ -343,7 +331,7 @@ void yyfree (void *  );
343 331
 
344 332
 typedef unsigned char YY_CHAR;
345 333
 
346
-FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
334
+FILE *yyin = NULL, *yyout = NULL;
347 335
 
348 336
 typedef int yy_state_type;
349 337
 
@@ -360,17 +348,14 @@ extern char *yytext;
360 348
 static yy_state_type yy_get_previous_state (void );
361 349
 static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
362 350
 static int yy_get_next_buffer (void );
363
-#if defined(__GNUC__) && __GNUC__ >= 3
364
-__attribute__((__noreturn__))
365
-#endif
366
-static void yy_fatal_error (yyconst char msg[]  );
351
+static void yynoreturn yy_fatal_error (yyconst char* msg  );
367 352
 
368 353
 /* Done after the current pattern has been matched and before the
369 354
  * corresponding action - sets up yytext.
370 355
  */
371 356
 #define YY_DO_BEFORE_ACTION \
372 357
 	(yytext_ptr) = yy_bp; \
373
-	yyleng = (size_t) (yy_cp - yy_bp); \
358
+	yyleng = (int) (yy_cp - yy_bp); \
374 359
 	(yy_hold_char) = *yy_cp; \
375 360
 	*yy_cp = '\0'; \
376 361
 	(yy_c_buf_p) = yy_cp;
@@ -633,7 +618,7 @@ static void update_loc(YYLTYPE *yylloc, char *yytext){
633 618
 <STRING>. { str_putc(*yytext); }
634 619
 
635 620
 */
636
-#line 637 "lex.yy.c"
621
+#line 622 "lex.yy.c"
637 622
 
638 623
 #define INITIAL 0
639 624
 
@@ -672,7 +657,7 @@ FILE *yyget_out (void );
672 657
 
673 658
 void yyset_out  (FILE * _out_str  );
674 659
 
675
-yy_size_t yyget_leng (void );
660
+			int yyget_leng (void );
676 661
 
677 662
 char *yyget_text (void );
678 663
 
@@ -739,7 +724,7 @@ static int input (void );
739 724
 /* This used to be an fputs(), but since the string might contain NUL's,
740 725
  * we now use fwrite().
741 726
  */
742
-#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
727
+#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
743 728
 #endif
744 729
 
745 730
 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
@@ -763,7 +748,7 @@ static int input (void );
763 748
 	else \
764 749
 		{ \
765 750
 		errno=0; \
766
-		while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
751
+		while ( (result = (int) fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
767 752
 			{ \
768 753
 			if( errno != EINTR) \
769 754
 				{ \
@@ -872,7 +857,7 @@ YY_DECL
872 857
 #line 85 "tokenizer.lex"
873 858
 
874 859
 
875
-#line 876 "lex.yy.c"
860
+#line 861 "lex.yy.c"
876 861
 
877 862
 	while ( /*CONSTCOND*/1 )		/* loops until end-of-file is reached */
878 863
 		{
@@ -902,7 +887,7 @@ yy_match:
902 887
 				if ( yy_current_state >= 148 )
903 888
 					yy_c = yy_meta[(unsigned int) yy_c];
904 889
 				}
905
-			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
890
+			yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
906 891
 			++yy_cp;
907 892
 			}
908 893
 		while ( yy_base[yy_current_state] != 162 );
@@ -1293,7 +1278,7 @@ YY_RULE_SETUP
1293 1278
 #line 229 "tokenizer.lex"
1294 1279
 ECHO;
1295 1280
 	YY_BREAK
1296
-#line 1297 "lex.yy.c"
1281
+#line 1282 "lex.yy.c"
1297 1282
 case YY_STATE_EOF(INITIAL):
1298 1283
 	yyterminate();
1299 1284
 
@@ -1480,7 +1465,7 @@ static int yy_get_next_buffer (void)
1480 1465
 
1481 1466
 	else
1482 1467
 		{
1483
-			yy_size_t num_to_read =
1468
+			int num_to_read =
1484 1469
 			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1485 1470
 
1486 1471
 		while ( num_to_read <= 0 )
@@ -1494,7 +1479,7 @@ static int yy_get_next_buffer (void)
1494 1479
 
1495 1480
 			if ( b->yy_is_our_buffer )
1496 1481
 				{
1497
-				yy_size_t new_size = b->yy_buf_size * 2;
1482
+				int new_size = b->yy_buf_size * 2;
1498 1483
 
1499 1484
 				if ( new_size <= 0 )
1500 1485
 					b->yy_buf_size += b->yy_buf_size / 8;
@@ -1507,7 +1492,7 @@ static int yy_get_next_buffer (void)
1507 1492
 				}
1508 1493
 			else
1509 1494
 				/* Can't grow it, we don't own it. */
1510
-				b->yy_ch_buf = 0;
1495
+				b->yy_ch_buf = NULL;
1511 1496
 
1512 1497
 			if ( ! b->yy_ch_buf )
1513 1498
 				YY_FATAL_ERROR(
@@ -1549,9 +1534,9 @@ static int yy_get_next_buffer (void)
1549 1534
 	else
1550 1535
 		ret_val = EOB_ACT_CONTINUE_SCAN;
1551 1536
 
1552
-	if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1537
+	if ((int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1553 1538
 		/* Extend the array by 50%, plus the number we really need. */
1554
-		yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1539
+		int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1555 1540
 		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
1556 1541
 		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1557 1542
 			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
@@ -1589,7 +1574,7 @@ static int yy_get_next_buffer (void)
1589 1574
 			if ( yy_current_state >= 148 )
1590 1575
 				yy_c = yy_meta[(unsigned int) yy_c];
1591 1576
 			}
1592
-		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1577
+		yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
1593 1578
 		}
1594 1579
 
1595 1580
 	return yy_current_state;
@@ -1617,7 +1602,7 @@ static int yy_get_next_buffer (void)
1617 1602
 		if ( yy_current_state >= 148 )
1618 1603
 			yy_c = yy_meta[(unsigned int) yy_c];
1619 1604
 		}
1620
-	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1605
+	yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
1621 1606
 	yy_is_jam = (yy_current_state == 147);
1622 1607
 
1623 1608
 		return yy_is_jam ? 0 : yy_current_state;
@@ -1637,7 +1622,7 @@ static int yy_get_next_buffer (void)
1637 1622
 	if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1638 1623
 		{ /* need to shift things up to make room */
1639 1624
 		/* +2 for EOB chars. */
1640
-		yy_size_t number_to_move = (yy_n_chars) + 2;
1625
+		int number_to_move = (yy_n_chars) + 2;
1641 1626
 		char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1642 1627
 					YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1643 1628
 		char *source =
@@ -1649,7 +1634,7 @@ static int yy_get_next_buffer (void)
1649 1634
 		yy_cp += (int) (dest - source);
1650 1635
 		yy_bp += (int) (dest - source);
1651 1636
 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1652
-			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1637
+			(yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1653 1638
 
1654 1639
 		if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1655 1640
 			YY_FATAL_ERROR( "flex scanner push-back overflow" );
@@ -1688,7 +1673,7 @@ static int yy_get_next_buffer (void)
1688 1673
 
1689 1674
 		else
1690 1675
 			{ /* need more input */
1691
-			yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1676
+			int offset = (yy_c_buf_p) - (yytext_ptr);
1692 1677
 			++(yy_c_buf_p);
1693 1678
 
1694 1679
 			switch ( yy_get_next_buffer(  ) )
@@ -1712,7 +1697,7 @@ static int yy_get_next_buffer (void)
1712 1697
 				case EOB_ACT_END_OF_FILE:
1713 1698
 					{
1714 1699
 					if ( yywrap( ) )
1715
-						return EOF;
1700
+						return 0;
1716 1701
 
1717 1702
 					if ( ! (yy_did_buffer_switch_on_eof) )
1718 1703
 						YY_NEW_FILE;
@@ -1960,7 +1945,7 @@ void yypop_buffer_state (void)
1960 1945
  */
1961 1946
 static void yyensure_buffer_stack (void)
1962 1947
 {
1963
-	yy_size_t num_to_alloc;
1948
+	int num_to_alloc;
1964 1949
     
1965 1950
 	if (!(yy_buffer_stack)) {
1966 1951
 
@@ -1968,7 +1953,7 @@ static void yyensure_buffer_stack (void)
1968 1953
 		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1969 1954
 		 * immediate realloc on the next call.
1970 1955
          */
1971
-		num_to_alloc = 1; // After all that talk, this was set to 1 anyways...
1956
+      num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1972 1957
 		(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1973 1958
 								(num_to_alloc * sizeof(struct yy_buffer_state*)
1974 1959
 								);
@@ -2015,7 +2000,7 @@ YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
2015 2000
 	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
2016 2001
 	     base[size-1] != YY_END_OF_BUFFER_CHAR )
2017 2002
 		/* They forgot to leave room for the EOB's. */
2018
-		return 0;
2003
+		return NULL;
2019 2004
 
2020 2005
 	b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
2021 2006
 	if ( ! b )
@@ -2024,7 +2009,7 @@ YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
2024 2009
 	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
2025 2010
 	b->yy_buf_pos = b->yy_ch_buf = base;
2026 2011
 	b->yy_is_our_buffer = 0;
2027
-	b->yy_input_file = 0;
2012
+	b->yy_input_file = NULL;
2028 2013
 	b->yy_n_chars = b->yy_buf_size;
2029 2014
 	b->yy_is_interactive = 0;
2030 2015
 	b->yy_at_bol = 1;
@@ -2047,7 +2032,7 @@ YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
2047 2032
 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
2048 2033
 {
2049 2034
     
2050
-	return yy_scan_bytes(yystr,strlen(yystr) );
2035
+	return yy_scan_bytes(yystr,(int) strlen(yystr) );
2051 2036
 }
2052 2037
 
2053 2038
 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
@@ -2057,7 +2042,7 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
2057 2042
  * 
2058 2043
  * @return the newly allocated buffer state object.
2059 2044
  */
2060
-YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len )
2045
+YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
2061 2046
 {
2062 2047
 	YY_BUFFER_STATE b;
2063 2048
 	char *buf;
@@ -2065,7 +2050,7 @@ YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len
2065 2050
 	yy_size_t i;
2066 2051
     
2067 2052
 	/* Get memory for full buffer, including space for trailing EOB's. */
2068
-	n = _yybytes_len + 2;
2053
+	n = (yy_size_t) _yybytes_len + 2;
2069 2054
 	buf = (char *) yyalloc(n  );
2070 2055
 	if ( ! buf )
2071 2056
 		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
@@ -2091,7 +2076,7 @@ YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len
2091 2076
 #define YY_EXIT_FAILURE 2
2092 2077
 #endif
2093 2078
 
2094
-static void yy_fatal_error (yyconst char* msg )
2079
+static void yynoreturn yy_fatal_error (yyconst char* msg )
2095 2080
 {
2096 2081
 			(void) fprintf( stderr, "%s\n", msg );
2097 2082
 	exit( YY_EXIT_FAILURE );
@@ -2144,7 +2129,7 @@ FILE *yyget_out  (void)
2144 2129
 /** Get the length of the current token.
2145 2130
  * 
2146 2131
  */
2147
-yy_size_t yyget_leng  (void)
2132
+int yyget_leng  (void)
2148 2133
 {
2149 2134
         return yyleng;
2150 2135
 }
@@ -2200,10 +2185,10 @@ static int yy_init_globals (void)
2200 2185
      * This function is called from yylex_destroy(), so don't allocate here.
2201 2186
      */
2202 2187
 
2203
-    (yy_buffer_stack) = 0;
2188
+    (yy_buffer_stack) = NULL;
2204 2189
     (yy_buffer_stack_top) = 0;
2205 2190
     (yy_buffer_stack_max) = 0;
2206
-    (yy_c_buf_p) = (char *) 0;
2191
+    (yy_c_buf_p) = NULL;
2207 2192
     (yy_init) = 0;
2208 2193
     (yy_start) = 0;
2209 2194
 
@@ -2212,8 +2197,8 @@ static int yy_init_globals (void)
2212 2197
     yyin = stdin;
2213 2198
     yyout = stdout;
2214 2199
 #else
2215
-    yyin = (FILE *) 0;
2216
-    yyout = (FILE *) 0;
2200
+    yyin = NULL;
2201
+    yyout = NULL;
2217 2202
 #endif
2218 2203
 
2219 2204
     /* For future reference: Set errno on error, since we are called by
@@ -2271,7 +2256,7 @@ static int yy_flex_strlen (yyconst char * s )
2271 2256
 
2272 2257
 void *yyalloc (yy_size_t  size )
2273 2258
 {
2274
-			return (void *) malloc( size );
2259
+			return malloc(size);
2275 2260
 }
2276 2261
 
2277 2262
 void *yyrealloc  (void * ptr, yy_size_t  size )
@@ -2284,7 +2269,7 @@ void *yyrealloc  (void * ptr, yy_size_t  size )
2284 2269
 	 * any pointer type to void*, and deal with argument conversions
2285 2270
 	 * as though doing an assignment.
2286 2271
 	 */
2287
-	return (void *) realloc( (char *) ptr, size );
2272
+	return realloc(ptr, size);
2288 2273
 }
2289 2274
 
2290 2275
 void yyfree (void * ptr )

+ 6
- 4
solrun.c View File

@@ -8,6 +8,7 @@ int main(int argc, char **argv) {
8 8
 	char *c;
9 9
 	int printtree = 0;
10 10
 	FILE *prgstream = stdin;
11
+	int result = 0;
11 12
 
12 13
 	if(argc > 1) {
13 14
 		c = argv[1];
@@ -24,7 +25,7 @@ int main(int argc, char **argv) {
24 25
 				case 'r':
25 26
 					if(argc < 2) {
26 27
 						printf("r option requires file\n");
27
-						return 1;
28
+						return 2;
28 29
 					}
29 30
 					prgstream = fopen(argv[2], "r");
30 31
 			}
@@ -34,14 +35,14 @@ int main(int argc, char **argv) {
34 35
 
35 36
 	if(!prgstream) {
36 37
 		printf("No input program (check filenames)\n");
37
-		return 1;
38
+		return 2;
38 39
 	}
39 40
 
40 41
 	program = sol_compile_file(prgstream);
41 42
 	
42 43
 	if(!program) {
43 44
 		printf("NULL program (probably a syntax error)\n");
44
-		return 1;
45
+		return 2;
45 46
 	}
46 47
 
47 48
 	if(prgstream != stdin) {
@@ -59,6 +60,7 @@ int main(int argc, char **argv) {
59 60
 		printf("Error: ");
60 61
 		ob_print(state.error);
61 62
 		printf("\n");
63
+		result = 1;
62 64
 	}
63 65
 
64 66
 	if(state.ret) {
@@ -69,5 +71,5 @@ int main(int argc, char **argv) {
69 71
 	st_free(program);
70 72
 	sol_state_cleanup(&state);
71 73
 
72
-	return 0;
74
+	return result;
73 75
 }

Loading…
Cancel
Save