Skip to content

Commit

Permalink
Remove redundant error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Gavin Howard committed Apr 9, 2019
1 parent 21f1115 commit f461497
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 28 deletions.
4 changes: 1 addition & 3 deletions include/status.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,7 @@ typedef enum BcError {
BC_ERROR_POSIX_BOOL,
BC_ERROR_POSIX_REL_POS,
BC_ERROR_POSIX_MULTIREL,
BC_ERROR_POSIX_FOR1,
BC_ERROR_POSIX_FOR2,
BC_ERROR_POSIX_FOR3,
BC_ERROR_POSIX_FOR,
BC_ERROR_POSIX_EXP_NUM,
BC_ERROR_POSIX_REF,
BC_ERROR_POSIX_BRACE,
Expand Down
10 changes: 4 additions & 6 deletions locales/de_DE.ISO8859-1.msg
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,10 @@ $set 4
21 "POSIX erlaubt den Operator \"%s\" nicht"
22 "POSIX erlaubt keine Vergleichsoperatoren au�erhalb von if-Anweisungen oder Schleifen"
23 "POSIX ben�tigt 0 oder 1 Vergleichsoperatoren pro Bedingung"
24 "POSIX erlaubt keinen leeren Initialisierungs-Ausdruck in einer for-Schleife"
25 "POSIX erlaubt keinen leeren Bedingungsausdruck in einer for-Schleife"
26 "POSIX erlaubt keinen leeren Aktualisierungs-Ausdruck in einer for-Schleife"
27 "POSIX erlaubt keine exponentielle Notation"
28 "POSIX erlaubt keine Feld-Referenzen als Funktionsparameter"
29 "POSIX erfordert, dass die linke Klammer auf der gleichen Linie wie der Funktionskopf steht"
24 "POSIX erlaubt keinen leeren Ausdruck in einer for-Schleife"
25 "POSIX erlaubt keine exponentielle Notation"
26 "POSIX erlaubt keine Feld-Referenzen als Funktionsparameter"
27 "POSIX erfordert, dass die linke Klammer auf der gleichen Linie wie der Funktionskopf steht"

$ Runtime errors.
$set 5
Expand Down
10 changes: 4 additions & 6 deletions locales/de_DE.UTF-8.msg
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,10 @@ $set 4
21 "POSIX erlaubt den Operator \"%s\" nicht"
22 "POSIX erlaubt keine Vergleichsoperatoren außerhalb von if-Anweisungen oder Schleifen"
23 "POSIX benötigt 0 oder 1 Vergleichsoperatoren pro Bedingung"
24 "POSIX erlaubt keinen leeren Initialisierungs-Ausdruck in einer for-Schleife"
25 "POSIX erlaubt keinen leeren Bedingungsausdruck in einer for-Schleife"
26 "POSIX erlaubt keinen leeren Aktualisierungs-Ausdruck in einer for-Schleife"
27 "POSIX erlaubt keine exponentielle Notation"
28 "POSIX erlaubt keine Feld-Referenzen als Funktionsparameter"
29 "POSIX erfordert, dass die linke Klammer auf der gleichen Linie wie der Funktionskopf steht"
24 "POSIX erlaubt keinen leeren Ausdruck in einer for-Schleife"
25 "POSIX erlaubt keine exponentielle Notation"
26 "POSIX erlaubt keine Feld-Referenzen als Funktionsparameter"
27 "POSIX erfordert, dass die linke Klammer auf der gleichen Linie wie der Funktionskopf steht"

$ Runtime errors.
$set 5
Expand Down
10 changes: 4 additions & 6 deletions locales/en_US.msg
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,10 @@ $set 4
21 "POSIX does not allow the following operator: %s"
22 "POSIX does not allow comparison operators outside if statements or loops"
23 "POSIX requires 0 or 1 comparison operators per condition"
24 "POSIX does not allow an empty init expression in a for loop"
25 "POSIX does not allow an empty condition expression in a for loop"
26 "POSIX does not allow an empty update expression in a for loop"
27 "POSIX does not allow exponential notation"
28 "POSIX does not allow array references as function parameters"
29 "POSIX requires the left brace be on the same line as the function header"
24 "POSIX requires all 3 parts of a for loop to be non-empty"
25 "POSIX does not allow exponential notation"
26 "POSIX does not allow array references as function parameters"
27 "POSIX requires the left brace be on the same line as the function header"

$ Runtime errors.
$set 5
Expand Down
6 changes: 3 additions & 3 deletions src/bc/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ static BcStatus bc_parse_for(BcParse *p) {
s = bc_parse_expr_status(p, 0, bc_parse_next_for);
if (BC_NO_ERR(!s)) bc_parse_push(p, BC_INST_POP);
}
else s = bc_parse_err(p, BC_ERROR_POSIX_FOR1);
else s = bc_parse_err(p, BC_ERROR_POSIX_FOR);

if (BC_ERR(s)) return s;
if (BC_ERR(p->l.t != BC_LEX_SCOLON))
Expand All @@ -748,7 +748,7 @@ static BcStatus bc_parse_for(BcParse *p) {
bc_vec_string(&p->l.str, strlen(bc_parse_const1), bc_parse_const1);
bc_parse_number(p);

s = bc_parse_err(p, BC_ERROR_POSIX_FOR2);
s = bc_parse_err(p, BC_ERROR_POSIX_FOR);
}

if (BC_ERR(s)) return s;
Expand All @@ -769,7 +769,7 @@ static BcStatus bc_parse_for(BcParse *p) {
s = bc_parse_expr_status(p, 0, bc_parse_next_rel);
if (BC_NO_ERR(!s)) bc_parse_push(p, BC_INST_POP);
}
else s = bc_parse_err(p, BC_ERROR_POSIX_FOR3);
else s = bc_parse_err(p, BC_ERROR_POSIX_FOR);

if (BC_ERR(s)) return s;

Expand Down
5 changes: 1 addition & 4 deletions src/data.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ const char bc_err_ids[] = {
BC_ERR_IDX_PARSE, BC_ERR_IDX_PARSE, BC_ERR_IDX_PARSE, BC_ERR_IDX_PARSE,
BC_ERR_IDX_PARSE, BC_ERR_IDX_PARSE, BC_ERR_IDX_PARSE, BC_ERR_IDX_PARSE,
BC_ERR_IDX_PARSE, BC_ERR_IDX_PARSE, BC_ERR_IDX_PARSE, BC_ERR_IDX_PARSE,
BC_ERR_IDX_PARSE, BC_ERR_IDX_PARSE,
#endif // BC_ENABLED

};
Expand Down Expand Up @@ -156,9 +155,7 @@ const char* const bc_err_msgs[] = {
"POSIX does not allow the following operator: %s",
"POSIX does not allow comparison operators outside if statements or loops",
"POSIX requires 0 or 1 comparison operators per condition",
"POSIX does not allow an empty init expression in a for loop",
"POSIX does not allow an empty condition expression in a for loop",
"POSIX does not allow an empty update expression in a for loop",
"POSIX requires all 3 parts of a for loop to be non-empty",
#if BC_ENABLE_EXTRA_MATH
"POSIX does not allow exponential notation",
#else
Expand Down

0 comments on commit f461497

Please sign in to comment.