consume function in the parsing module