Skip to content

Commit f1470bb

Browse files
committed
add two parser warnings
1 parent 948f2bc commit f1470bb

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

include/express/resolve.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ GLOBAL SCL_EXPRESS_EXPORT Error ERROR_circular_reference INITIALLY( ERROR_
6565
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_ambiguous_attribute INITIALLY( ERROR_none );
6666
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_ambiguous_group INITIALLY( ERROR_none );
6767

68+
GLOBAL SCL_EXPRESS_EXPORT Error WARNING_case_skip_label INITIALLY( ERROR_none );
69+
GLOBAL SCL_EXPRESS_EXPORT Error WARNING_fn_skip_branch INITIALLY( ERROR_none );
70+
6871
#undef GLOBAL
6972
#undef INITIALLY
7073

src/express/resolve.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,16 @@ void RESOLVEinitialize( void ) {
213213
ERROR_missing_self = ERRORcreate(
214214
"Domain rule %s must refer to SELF or attribute.", SEVERITY_ERROR );
215215

216+
WARNING_fn_skip_branch = ERRORcreate(
217+
"IF statement condition is always %s. Ignoring branch that is never taken.", SEVERITY_WARNING );
218+
219+
WARNING_case_skip_label = ERRORcreate("CASE label %s cannot be matched. Ignoring its statements.", SEVERITY_WARNING);
220+
216221
ERRORcreate_warning( "circular_subtype", ERROR_subsuper_loop );
217222
ERRORcreate_warning( "circular_select", ERROR_select_loop );
218223
ERRORcreate_warning( "entity_as_type", ERROR_type_is_entity );
224+
ERRORcreate_warning( "invariant_condition", WARNING_fn_skip_branch );
225+
ERRORcreate_warning( "invalid_case", WARNING_case_skip_label );
219226
}
220227

221228
/** Clean up the Fed-X second pass */
@@ -252,6 +259,8 @@ void RESOLVEcleanup( void ) {
252259
ERRORdestroy( ERROR_redecl_no_such_attribute );
253260
ERRORdestroy( ERROR_redecl_no_such_supertype );
254261
ERRORdestroy( ERROR_missing_self );
262+
ERRORdestroy( WARNING_case_skip_label );
263+
ERRORdestroy( WARNING_fn_skip_branch );
255264
}
256265

257266
/**

0 commit comments

Comments
 (0)