Add a warning for unsupported language features, and print it for indexing upon a binary

This commit is contained in:
Mark Pictor
2012-01-26 20:11:59 -05:00
parent 064a2b41b5
commit 4cd7e7c806
3 changed files with 11 additions and 6 deletions
+1
View File
@@ -125,6 +125,7 @@ GLOBAL SCL_EXPRESS_EXPORT Error ERROR_syntax INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_unlabelled_param_type INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_file_unreadable;
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_file_unwriteable;
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_warn_unsupported_lang_feat;
GLOBAL SCL_EXPRESS_EXPORT struct Scope_ * FUNC_NVL;
GLOBAL SCL_EXPRESS_EXPORT struct Scope_ * FUNC_USEDIN;
+5 -2
View File
@@ -1,7 +1,7 @@
/************************************************************************
** Module: Expression
/** **********************************************************************
** Module: Expression \file expr.c
** Description: This module implements the Expression abstraction. Several
** types of expressions are supported: identifiers, literals,
** operations (arithmetic, logical, array indexing, etc.), and
@@ -667,6 +667,9 @@ Type EXPresolve_op_array_like( Expression e, Scope s ) {
return( op1type );
} else if( op1type == Type_Runtime ) {
return( Type_Runtime );
} else if( op1type->u.type->body->type == binary_ ) {
ERRORreport_with_symbol( ERROR_warn_unsupported_lang_feat, &e->symbol, "indexing on a BINARY",__FILE__, __LINE__ );
return( Type_Binary );
} else if( op1type->u.type->body->type == generic_ ) {
return( Type_Generic );
} else if( TYPEis_select( op1type ) ) {
+5 -4
View File
@@ -350,13 +350,14 @@ EXPRESSinitialize( void ) {
"Schema %s was not found in its own schema file (%s)", SEVERITY_ERROR );
ERROR_unlabelled_param_type = ERRORcreate(
"Return type or local variable requires type label in `%s'", SEVERITY_ERROR );
ERROR_file_unreadable = ERRORcreate(
"Could not read file %s: %s", SEVERITY_ERROR );
ERROR_file_unwriteable = ERRORcreate(
"Could not write file %s: %s", SEVERITY_ERROR );
ERROR_file_unreadable = ERRORcreate( "Could not read file %s: %s", SEVERITY_ERROR );
ERROR_file_unwriteable = ERRORcreate( "Could not write file %s: %s", SEVERITY_ERROR );
ERROR_warn_unsupported_lang_feat = ERRORcreate("Unsupported language feature (%s) at %s:%d",SEVERITY_WARNING);
OBJcreate( OBJ_EXPRESS, EXPRESS_get_symbol, "express file", OBJ_UNUSED_BITS );
ERRORcreate_warning( "unknown_subtype", ERROR_unknown_subtype );
ERRORcreate_warning( "unsupported", ERROR_warn_unsupported_lang_feat );
EXPRESS_PATHinit(); /* note, must follow defn of errors it needs! */
}