index=index_plusifindex_plus<index_minuselseindex_minus# Set the index to the index of the operator that occurs first
subexpr[index]=float(subexpr[index-1])+float(subexpr[index+1])ifindex_plus<index_minuselsefloat(subexpr[index-1])-float(subexpr[index+1])# If addition occured first, add the previous and next tokens. If subtraction occured first, subtract them.