fix bug that caused hang when parsing comments in grammar files