Update parser.js

Added normalization of rules during parsing. getting all rules.