MAP-964: refinement of rule parsing