merge of patterns.go and tokens.go