fix a bug on grammar by not keeping keywords sorted