improved parsing to allow spaces after rule names