Pull patches from janneke

This commit is contained in:
Jeremiah Orians 2018-08-26 21:15:32 -04:00
parent e249069cac
commit 32f2adafda
No known key found for this signature in database
GPG Key ID: 7457821534D2ACCD
5 changed files with 30 additions and 14 deletions

View File

@ -16,6 +16,17 @@
* Current
** Added
Added support for \f, \v and \e
** Changed
Converted M2-Planet to use GNU style error message
** Fixed
** Removed
* 1.0 - 2018-08-26
** Added
Added more generic logic to lookup_type
Added prim_types to simply the task of reducing search space to primitives

View File

@ -1,4 +1,5 @@
/* Copyright (C) 2016 Jeremiah Orians
* Copyright (C) 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* This file is part of stage0.
*
* stage0 is free software: you can redistribute it and/or modify
@ -93,18 +94,18 @@ struct token_list* sym_lookup(char *s, struct token_list* symbol_list)
void line_error()
{
file_print("In file: ", stderr);
file_print(global_token->filename, stderr);
file_print(" On line: ", stderr);
file_print(":", stderr);
file_print(numerate_number(global_token->linenumber), stderr);
file_print(":", stderr);
}
void require_match(char* message, char* required)
{
if(!match(global_token->s, required))
{
file_print(message, stderr);
line_error();
file_print(message, stderr);
exit(EXIT_FAILURE);
}
global_token = global_token->next;
@ -218,10 +219,10 @@ void global_load(struct token_list* a)
void primary_expr_failure()
{
line_error();
file_print("Recieved ", stderr);
file_print(global_token->s, stderr);
file_print(" in primary_expr\n", stderr);
line_error();
exit(EXIT_FAILURE);
}
@ -296,9 +297,9 @@ void primary_expr_variable()
return;
}
line_error();
file_print(s ,stderr);
file_print(" is not a defined symbol\n", stderr);
line_error();
exit(EXIT_FAILURE);
}
@ -856,8 +857,8 @@ void process_break()
{
if(NULL == break_target_head)
{
file_print("Not inside of a loop or case statement", stderr);
line_error();
file_print("Not inside of a loop or case statement", stderr);
exit(EXIT_FAILURE);
}
struct token_list* i = function->locals;
@ -1132,10 +1133,10 @@ new_type:
}
else
{
line_error();
file_print("Recieved ", stderr);
file_print(global_token->s, stderr);
file_print(" in program\n", stderr);
line_error();
exit(EXIT_FAILURE);
}
@ -1144,10 +1145,10 @@ new_type:
}
else
{
line_error();
file_print("Recieved ", stderr);
file_print(global_token->s, stderr);
file_print(" in program\n", stderr);
line_error();
exit(EXIT_FAILURE);
}
}

View File

@ -1,4 +1,5 @@
/* Copyright (C) 2016 Jeremiah Orians
* Copyright (C) 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* This file is part of stage0.
*
* stage0 is free software: you can redistribute it and/or modify
@ -80,12 +81,15 @@ int escape_lookup(char* c)
int t2 = hexify(c[3], FALSE);
return t1 + t2;
}
else if(c[1] == 'n') return 10;
else if(c[1] == 't') return 9;
else if(c[1] == '\\') return 92;
else if(c[1] == '\'') return 39;
else if(c[1] == '"') return 34;
else if(c[1] == 'n') return 10;
else if(c[1] == 'v') return 11;
else if(c[1] == 'f') return 12;
else if(c[1] == 'r') return 13;
else if(c[1] == 'e') return 27;
else if(c[1] == '"') return 34;
else if(c[1] == '\'') return 39;
else if(c[1] == '\\') return 92;
file_print("Unknown escape recieved: ", stderr);
file_print(c, stderr);

View File

@ -9,7 +9,7 @@ b45fae655b7f848b28ebdb8eb2e30ae789fbcf7920bc315395d53986bb1adae4 test/results/t
d511db73158a9544a5b5f828a79751e3de8a04b81c143fd0c146fc22c938aa9f test/results/test08-binary
907e1808f2e2b15ac72ebf13898b15c678e68ebd43d673dcd0f408d907e7962f test/results/test09-binary
ef179cd359ba1d61d45089e314cd4ac2069c8dc4dd7494d7c766344ea3c8cf88 test/results/test10-binary
cefac04111bd46b335b6ebf995c07989920fbdbb3eb07e0b29fb7d62dcc70cfe test/results/test100-binary
c8ce64deba0328a86f53fe7cbeeec54965af9e0c884c3cd8b4e75518c305c831 test/results/test100-binary
5aaf399fe706d4a8c85c121c75ada29a65c293b57c98e8999961a2ef0bab0d62 test/results/test11-binary
4f8111e73e07255ae203963438c82ea8bcff7474e1594b52b426c58a03cb30eb test/results/test12-binary
dd74dabfdce8657ff440c1eef531cbf67a64854f2020d4d6bcb65c9cc2d199cb test/results/test13-binary

View File

@ -1 +1 @@
4715ce02b077c7487b9d131b5581e662f3c15360bd70371b490bf4563193b9bd test/test100/proof
4672d6a69bbe2717b264cd5caa8a366a076a23f18435283fb4fb9a155186c984 test/test100/proof