| 9736 | } |
| 9737 | |
| 9738 | struct properties_enrollment_allowed { |
| 9739 | int& times_through; |
| 9740 | std::bitset<64>& properties; |
| 9741 | automagic_enrollments& enrollments; |
| 9742 | |
| 9743 | properties_enrollment_allowed(int& times, std::bitset<64>& props, automagic_enrollments& enroll) |
| 9744 | : times_through(times), properties(props), enrollments(enroll) { |
| 9745 | } |
| 9746 | |
| 9747 | bool operator()(meta_function mf) const { |
| 9748 | bool p = properties[static_cast<int>(mf)]; |
| 9749 | if (times_through > 0) { |
| 9750 | return p; |
| 9751 | } |
| 9752 | switch (mf) { |
| 9753 | case meta_function::length: |
| 9754 | return enrollments.length_operator && !p; |
| 9755 | case meta_function::pairs: |
| 9756 | return enrollments.pairs_operator && !p; |
| 9757 | case meta_function::call: |
| 9758 | return enrollments.call_operator && !p; |
| 9759 | case meta_function::less_than: |
| 9760 | return enrollments.less_than_operator && !p; |
| 9761 | case meta_function::less_than_or_equal_to: |
| 9762 | return enrollments.less_than_or_equal_to_operator && !p; |
| 9763 | case meta_function::equal_to: |
| 9764 | return enrollments.equal_to_operator && !p; |
| 9765 | default: |
| 9766 | break; |
| 9767 | } |
| 9768 | return !p; |
| 9769 | } |
| 9770 | }; |
| 9771 | |
| 9772 | struct indexed_insert { |
| 9773 | lua_reg_table& l; |