[stcheck] fix syntax checker to allow using CAST outside selection [folded]