added back scarlett's simple statement work
This commit is contained in:
@ -261,14 +261,22 @@ compound_statement:
|
|||||||
;
|
;
|
||||||
|
|
||||||
simple_statement:
|
simple_statement:
|
||||||
assignable ASSIGN expression {if(strcmp($1, $3) == 0){
|
assignable ASSIGN expression
|
||||||
|
{
|
||||||
|
if(strcmp($1, $3) == 0) {
|
||||||
|
printdebug("Passed standard type check; assignable = expression");
|
||||||
|
} else if((strcmp($1, "rec") == 0) && (strcmp($3, "address") == 0)) {
|
||||||
|
printdebug("Passed rec type check; rec = address");
|
||||||
|
} else if((strcmp($1, "array") == 0) && (strcmp($3, "address") == 0)) {
|
||||||
|
printdebug("Passed array type check; array = address");
|
||||||
} else {
|
} else {
|
||||||
printdebug("Mismatch at line %d and column%d", @2.first_line, @2.first_column);
|
printdebug("%s[TYPE ERROR] %sMismatch at %sline %d and column %d%s", COLOR_ORANGE, COLOR_WHITE, COLOR_YELLOW, @2.first_line, @2.first_column, COLOR_WHITE);
|
||||||
}}
|
printdebug(" - Invalid types %s$1: %s and $3: %s%s", COLOR_YELLOW, $1, $3, COLOR_WHITE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
| RETURN expression
|
| RETURN expression
|
||||||
;
|
;
|
||||||
|
|
||||||
rec_op :
|
rec_op :
|
||||||
DOT
|
DOT
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user