handle warnings, warn for semicolon after if
changed return format to handle more general cases