[scan] stick operator parsing code together