Restore duplicate resource name check.

Refs #1996
Remove debug dump().
Fix keyword reference.
Simplify character class rules in grammar.
Return only the actual locale value from the parser.