Manual merge of NX-501-token-pattern-parser