DFHack / df-structures

Dwarf Fortress data structure descriptions
https://github.com/DFHack/dfhack
118 stars 81 forks source link

dfhack_knowledge_scholar_flag missing metadata (complex enum) #250

Closed PatrikLundell closed 6 years ago

PatrikLundell commented 6 years ago

I've tried to index the type to get at the string from Lua, but just get nil as a result, including with the (as of this writing) brand new 0.44.09 r1 version. I've compared the generated headers for this type to the randomly selected abstract_building_flags.h generated with 0.44.07 (probably alpha: the latest version I've generated on my computer) and this file contains an extra section for "template<> struct DFHACK_EXPORT enum_traits..." which has no correspondence in dfhack_knowledge_scholar_flag.h.

Since I can't see any obvious difference in how the two types are defined in the XML, I suspect there is some additional structure outside of the XML file the enum type is defined in that's responsible for the generation of this (very useful) functionality for enums.

lethosor commented 6 years ago

That's related to the warning that you see when running codegen.pl (the generate_headers target):

Warning: complex enum: dfhack_knowledge_scholar_flag

and is due to lines like this: https://github.com/DFHack/df-structures/blob/3c0bf63674d5430deadaf7befaec42f0ec1e8bc5/df.knowledge.xml#L448 codegen currently has no way to generate metadata for enums with holes in them, sorry.

Other than that, enum metadata is automatically generated, and there's nowhere else enums need to be listed for that to happen.

PatrikLundell commented 6 years ago

Thanks for explaining it.

Edit: I've poked around a bit. It looks like the Perl scripts probably could be updated to handle holes (but I've never used Perl...). I've also found another work around used elsewhere (df.buildings.xml:civzone_type): " Invalid Type", which causes the corresponding lines in static.enums.inc to resolve to: " NULL,".

If I had the choice, I'd use the latter method when there are just a few gaps in a sequence, and let an updated script fill out the holes when there are larger jumps, but the latter method should work as long as you're careful in checking you haven't missed out or added a line.

Edit 2: Looks like this generates a mapping of the correct length (in static.enums.inc):

'''

    <enum-item name='philosophy_logic_deductive_reasoning'/>
    <enum-item name='philosophy_logic_syllogistic_logic'/>
    <enum-item name='philosophy_logic_hypothetical_syllogisms'/>
    <enum-item name='philosophy_logic_propositional_logic'/>
    <enum-item name='philosophy_logic_dialectic_reasoning'/>
    <enum-item name='philosophy_logic_analogical_inference'/>
    <enum-item name='philosophy_ethics_applied_medical'/>

    <enum-item name='philosophy_ethics_individual_value'/>
    <enum-item name='philosophy_ethics_state_consequentialism'/>
    <enum-item name='philosophy_epistemology_truth'/>
    <enum-item name='philosophy_epistemology_perception'/>
    <enum-item name='philosophy_epistemology_justification'/>
    <enum-item name='philosophy_epistemology_belief'/>
    <enum-item name='philosophy_metaphysics_existence'/>
    <enum-item name='philosophy_metaphysics_time'/>

    <enum-item name='philosophy_metaphysics_mind_body'/>
    <enum-item name='philosophy_metaphysics_objects_and_properties'/>
    <enum-item name='philosophy_metaphysics_wholes_and_parts'/>
    <enum-item name='philosophy_metaphysics_events'/>
    <enum-item name='philosophy_metaphysics_processes'/>
    <enum-item name='philosophy_metaphysics_causation'/>
    <enum-item name='philosophy_ethics_applied_military'/>
    <enum-item name='philosophy_ethics_applied_interpersonal_conduct'/>

    <enum-item name='philosophy_specialized_law'/>
    <enum-item name='philosophy_specialized_education'/>
    <enum-item name='philosophy_specialized_language_grammar'/>
    <enum-item name='philosophy_specialized_language_etymology'/>
    <enum-item name='philosophy_specialized_politics_diplomacy'/>
    <enum-item name='philosophy_specialized_politics_government_forms'/>
    <enum-item name='philosophy_specialized_politics_economic_policy'/>
    <enum-item name='philosophy_specialized_politics_social_welfare'/>

    <enum-item name='philosophy_logic_inductive_reasoning' comment='32'/>
    <enum-item name='philosophy_logic_direct_inference'/>
    <enum-item name='philosophy_aesthetics_nature_of_beauty'/>
    <enum-item name='philosophy_aesthetics_value_of_art'/>
    <enum-item name='philosophy_specialized_language_dictionary'/>
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type

    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type

    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type

    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type

    <enum-item name='mathematics_method_proof_by_contradiction' comment='64'/>
    <enum-item name='mathematics_notation_zero'/>
    <enum-item name='mathematics_notation_negative_numbers'/>
    <enum-item name='mathematics_notation_large_numbers'/>
    <enum-item name='mathematics_notation_positional'/>
    <enum-item name='mathematics_geometry_basic_objects'/>
    <enum-item name='mathematics_method_exhaustion'/>
    <enum-item name='mathematics_geometry_similar_and_congruent_triangles'/>

    <enum-item name='mathematics_geometry_geometric_mean_theorem'/>
    <enum-item name='mathematics_geometry_isosceles_base_angles_equal'/>
    <enum-item name='mathematics_geometry_inscribed_triangle_on_diameter_is_right'/>
    <enum-item name='mathematics_geometry_pythagorean_theorem'/>
    <enum-item name='mathematics_geometry_pythagorean_triples_small'/>
    <enum-item name='mathematics_geometry_pythagorean_triples_3_digit'/>
    <enum-item name='mathematics_geometry_pythagorean_triples_4_digit'/>
    <enum-item name='mathematics_geometry_existence_of_incommensurable_ratios'/>

    <enum-item name='mathematics_method_axiomatic_reasoning'/>
    <enum-item name='mathematics_numbers_unique_prime_factorization'/>
    <enum-item name='mathematics_numbers_algorithm_for_computing_gcd'/>
    <enum-item name='mathematics_geometry_volume_of_pyramid'/>
    <enum-item name='mathematics_geometry_volume_of_cone'/>
    <enum-item name='mathematics_geometry_volume_of_sphere'/>
    <enum-item name='mathematics_geometry_pi_to_4_digits'/>
    <enum-item name='mathematics_numbers_division_algorithm'/>

    <enum-item name='mathematics_geometry_table_of_chord_values'/>
    <enum-item name='mathematics_geometry_area_of_triangle_from_side_lengths'/>
    <enum-item name='mathematics_geometry_area_of_circle'/>
    <enum-item name='mathematics_geometry_pi_to_6_digits'/>
    <enum-item name='mathematics_geometry_definitions_and_basic_properties_of_conic_sections'/>
    <enum-item name='mathematics_numbers_chinese_remainder_algorithm'/>
    <enum-item name='mathematics_geometry_area_enclosed_by_line_and_parabola'/>
    <enum-item name='mathematics_numbers_sieve_algorithm_for_primes'/>

    <enum-item name='mathematics_numbers_root_2_to_5_digits' comment='96'/>
    <enum-item name='mathematics_numbers_infinite_primes'/>
    <enum-item name='mathematics_numbers_root_2_irrational'/>
    <enum-item name='mathematics_geometry_surface_area_of_sphere'/>
    <enum-item name='mathematics_algebra_finite_summation_formulas'/>
    <enum-item name='mathematics_algebra_solving_linear_systems'/>
    <enum-item name='mathematics_algebra_balancing_and_completion'/>
    <enum-item name='mathematics_algebra_quadratic_by_completing_square'/>

    <enum-item name='mathematics_algebra_quadratic_formula'/>
    <enum-item name='mathematics_notation_syncopated_algebra'/>
    <enum-item name='mathematics_geometry_law_of_sines'/>
    <enum-item name='mathematics_geometry_angle_sum_difference_trig_identities'/>
    <enum-item name='mathematics_algebra_pascals_triangle'/>
    <enum-item name='mathematics_algebra_solving_higher_order_polynomials'/>
    <enum-item name='mathematics_notation_early_symbols_for_operations'/>
    <enum-item name='mathematics_algebra_divergence_of_harmonic_series'/>

    <enum-item name='mathematics_geometry_properties_of_chords'/>
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type

    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type

    <enum-item name='history_sourcing_basic_reliability' comment='128'/>
    <enum-item name='history_sourcing_role_of_systemic_bias'/>
    <enum-item name='history_sourcing_role_of_state_bias_and_propaganda'/>
    <enum-item name='history_sourcing_personal_interviews'/>
    <enum-item name='history_theory_historical_causation'/>
    <enum-item name='history_theory_historical_cycles'/>
    <enum-item name='history_theory_social_cohesion'/>
    <enum-item name='history_theory_social_conflict'/>

    <enum-item name='history_form_biography'/>
    <enum-item name='history_form_comparative_biography'/>
    <enum-item name='history_form_biographical_dictionaries'/>
    <enum-item name='history_form_autobiographical_adventure'/>
    <enum-item name='history_form_genealogy'/>
    <enum-item name='history_form_encyclopedia'/>
    <enum-item name='history_form_cultural_history'/>
    <enum-item name='history_form_cultural_comparison'/>

    <enum-item name='history_sourcing_role_of_cultural_differences'/>
    <enum-item name='history_form_alternate_history'/>
    <enum-item name='history_sourcing_basic_archaeology'/>
    <enum-item name='history_form_treatise_on_tech_evolution'/>
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type

    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type

    <enum-item name='astronomy_phases_of_the_moon' comment='160'/>
    <enum-item name='astronomy_summer_winter_moon'/>
    <enum-item name='astronomy_path_of_the_moon'/>
    <enum-item name='astronomy_tides_and_the_moon'/>
    <enum-item name='astronomy_height_of_tides_vs_moon_and_sun'/>
    <enum-item name='astronomy_summer_winter_sun'/>
    <enum-item name='astronomy_relationship_between_lunar_solar_year'/>
    <enum-item name='astronomy_daylight_variation_with_solar_year'/>

    <enum-item name='astronomy_geocentric_model'/>
    <enum-item name='astronomy_heliocentric_model'/>
    <enum-item name='astronomy_dates_of_lunar_and_solar_eclipses'/>
    <enum-item name='astronomy_star_charts'/>
    <enum-item name='astronomy_star_catalogues_100'/>
    <enum-item name='astronomy_star_catalogues_1000'/>
    <enum-item name='astronomy_star_color_classification'/>
    <enum-item name='astronomy_star_magnitude_classification'/>

    <enum-item name='astronomy_shape_of_the_world'/>
    <enum-item name='astronomy_precession_of_equinoxes'/>
    <enum-item name='astronomy_method_empirical_observation'/>
    <enum-item name='astronomy_method_path_models'/>
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type

    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type

    <enum-item name='naturalist_method_dissection' comment='192'/>
    <enum-item name='naturalist_observation_anatomy'/>
    <enum-item name='naturalist_theory_comparative_anatomy'/>
    <enum-item name='naturalist_theory_classification_by_physical_features'/>
    <enum-item name='naturalist_observation_migration_patterns'/>
    <enum-item name='naturalist_observation_reproductive_behavior'/>
    <enum-item name='naturalist_observation_foraging_behavior_and_diet'/>
    <enum-item name='naturalist_theory_food_chain'/>

    <enum-item name='naturalist_observation_social_behavior'/>
    <enum-item name='naturalist_observation_diseases'/>
    <enum-item name='naturalist_theory_climactic_adaptation'/>
    <enum-item name='naturalist_observation_embriological_development'/>
    <enum-item name='naturalist_theory_struggle_for_existence'/>
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type

    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type

    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type

    <enum-item name='chemistry_classification_combustibles' comment='224'/>
    <enum-item name='chemistry_classification_ores'/>
    <enum-item name='chemistry_metallurgy_alloys'/>
    <enum-item name='chemistry_classification_scratch_test'/>
    <enum-item name='chemistry_classification_elemental_theory'/>
    <enum-item name='chemistry_chemicals_adhesives'/>
    <enum-item name='chemistry_laboratory_blast_furnace'/>
    <enum-item name='chemistry_laboratory_alembic'/>

    <enum-item name='chemistry_laboratory_theory_of_liquid_liquid_extraction'/>
    <enum-item name='chemistry_laboratory_theory_of_distillation'/>
    <enum-item name='chemistry_laboratory_theory_of_evaporation'/>
    <enum-item name='chemistry_classification_alkali_and_acids'/>
    <enum-item name='chemistry_laboratory_systematic_experiments'/>
    <enum-item name='chemistry_laboratory_glass_flask'/>
    <enum-item name='chemistry_laboratory_glass_beaker'/>
    <enum-item name='chemistry_laboratory_glass_vial'/>

    <enum-item name='chemistry_laboratory_glass_funnel'/>
    <enum-item name='chemistry_laboratory_crucible'/>
    <enum-item name='chemistry_chemicals_nitric_acid'/>
    <enum-item name='chemistry_chemicals_sulfuric_acid'/>
    <enum-item name='chemistry_chemicals_aqua_regia'/>
    <enum-item name='chemistry_laboratory_glass_ampoule'/>
    <enum-item name='chemistry_laboratory_glass_retort'/>
    <enum-item name='chemistry_laboratory_lab_ovens'/>

    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type

    <enum-item name='geography_surveying_basic' comment='256'/>
    <enum-item name='geography_surveying_staff'/>
    <enum-item name='geography_cartography_basic'/>
    <enum-item name='geography_surveying_triangulation'/>
    <enum-item name='geography_surveying_cartographical'/>
    <enum-item name='geography_surveying_land'/>
    <enum-item name='geography_surveying_military'/>
    <enum-item name='geography_surveying_engineering'/>

    <enum-item name='geography_cartography_geological'/>
    <enum-item name='geography_cartography_grid_system'/>
    <enum-item name='geography_cartography_distance_scale'/>
    <enum-item name='geography_cartography_height_measurements'/>
    <enum-item name='geography_method_economic_data_collection'/>
    <enum-item name='geography_cartography_economic'/>
    <enum-item name='geography_form_atlas'/>
    <enum-item name='geography_theory_delta_formation'/>

    <enum-item name='geography_theory_wind_patterns'/>
    <enum-item name='geography_theory_origin_of_rainfall_from_evap_condense'/>
    <enum-item name='geography_theory_water_cycle'/>
    <enum-item name='geography_theory_latitude_climate_zones'/>
    <enum-item name='geography_cartography_accurate_maps'/>
    <enum-item name='geography_cartography_map_projections'/>
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type

    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type

    <enum-item name='medicine_theory_disease_and_fouled_water' comment='288'/>
    <enum-item name='medicine_method_physical_examination'/>
    <enum-item name='medicine_method_autopsy'/>
    <enum-item name='medicine_theory_prognosis'/>
    <enum-item name='medicine_tool_herbal_remedies'/>
    <enum-item name='medicine_tool_animal_remedies'/>
    <enum-item name='medicine_tool_mineral_remedies'/>
    <enum-item name='medicine_tool_bandages'/>

    <enum-item name='medicine_theory_disease_classification'/>
    <enum-item name='medicine_theory_toxicology'/>
    <enum-item name='medicine_theory_acute_and_chronic_conditions'/>
    <enum-item name='medicine_theory_endemic_disease'/>
    <enum-item name='medicine_theory_epidemic_disease'/>
    <enum-item name='medicine_theory_exacerbation'/>
    <enum-item name='medicine_theory_paroxysm'/>
    <enum-item name='medicine_theory_relapse'/>

    <enum-item name='medicine_theory_convalescence'/>
    <enum-item name='medicine_method_treatment_of_traumatic_injuries'/>
    <enum-item name='medicine_method_fracture_treatment'/>
    <enum-item name='medicine_theory_fracture_classification'/>
    <enum-item name='medicine_tool_traction_bench'/>
    <enum-item name='medicine_method_fracture_immobilization'/>
    <enum-item name='medicine_tool_orthopedic_cast'/>
    <enum-item name='medicine_method_surgery_excision'/>

    <enum-item name='medicine_method_surgery_incision'/>
    <enum-item name='medicine_method_hernia_surgery'/>
    <enum-item name='medicine_method_tracheotomy_surgery'/>
    <enum-item name='medicine_method_lithotomy_surgery'/>
    <enum-item name='medicine_method_surgery_scraping'/>
    <enum-item name='medicine_method_surgery_draining'/>
    <enum-item name='medicine_method_surgery_probing'/>
    <enum-item name='medicine_method_surgery_suturing'/>

    <enum-item name='medicine_method_surgery_ligature' comment='320'/>
    <enum-item name='medicine_theory_surgical_models'/>
    <enum-item name='medicine_tool_mud_bags_as_surgical_models'/>
    <enum-item name='medicine_tool_plants_as_surgical_models'/>
    <enum-item name='medicine_tool_animals_as_surgical_models'/>
    <enum-item name='medicine_theory_specialized_surgical_instruments'/>
    <enum-item name='medicine_tool_forceps'/>
    <enum-item name='medicine_tool_scalpel'/>

    <enum-item name='medicine_tool_surgical_scissors'/>
    <enum-item name='medicine_tool_surgical_needles'/>
    <enum-item name='medicine_method_cataract_surgery'/>
    <enum-item name='medicine_method_cauterization'/>
    <enum-item name='medicine_method_anesthesia'/>
    <enum-item name='medicine_theory_pulmonary_medicine'/>
    <enum-item name='medicine_theory_anatomical_studies'/>
    <enum-item name='medicine_theory_classification_of_bodily_fluids'/>

    <enum-item name='medicine_theory_eye_anatomy'/>
    <enum-item name='medicine_theory_motor_vs_sensory_nerves'/>
    <enum-item name='medicine_theory_nervous_system_function'/>
    <enum-item name='medicine_theory_reaction_time'/>
    <enum-item name='medicine_theory_blood_vessels'/>
    <enum-item name='medicine_theory_pulmonary_circulation'/>
    <enum-item name='medicine_theory_comparative_anatomy'/>
    <enum-item name='medicine_theory_the_voice'/>

    <enum-item name='medicine_theory_classification_of_muscles'/>
    <enum-item name='medicine_theory_classification_of_mental_illnesses'/>
    <enum-item name='medicine_theory_treatment_of_mental_illnesses'/>
    <enum-item name='medicine_tool_dedicated_hospitals'/>
    <enum-item name='medicine_method_professional_hospital_staff'/>
    <enum-item name='medicine_method_specialized_wards'/>
    <enum-item name='medicine_method_hospital_lab'/>
    <enum-item name='medicine_method_medical_school'/>

    <enum-item name='medicine_method_asylum_for_mentally_ill' comment='352'/>
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type

    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type

    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type

    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type

    <enum-item name='engineering_horology_shadow_clock' comment='384'/>
    <enum-item name='engineering_horology_water_clock'/>
    <enum-item name='engineering_horology_conical_water_clock'/>
    <enum-item name='engineering_horology_water_clock_reservoir'/>
    <enum-item name='engineering_horology_astrarium'/>
    <enum-item name='engineering_horology_hourglass'/>
    <enum-item name='engineering_horology_mechanical_clock'/>
    <enum-item name='engineering_machine_theory_of_pulley'/>

    <enum-item name='engineering_machine_pulley'/>
    <enum-item name='engineering_machine_theory_of_screw'/>
    <enum-item name='engineering_machine_screw'/>
    <enum-item name='engineering_machine_theory_of_wheel_and_axle'/>
    <enum-item name='engineering_machine_windlass'/>
    <enum-item name='engineering_machine_theory_of_wedge'/>
    <enum-item name='engineering_machine_theory_of_lever'/>
    <enum-item name='engineering_machine_lever'/>

    <enum-item name='engineering_machine_straight_beam_balance'/>
    <enum-item name='engineering_machine_theory_of_gears'/>
    <enum-item name='engineering_machine_warded_lock'/>
    <enum-item name='engineering_machine_tumbler_lock'/>
    <enum-item name='engineering_machine_padlock'/>
    <enum-item name='engineering_machine_camshaft'/>
    <enum-item name='engineering_machine_crankshaft'/>
    <enum-item name='engineering_machine_water_powered_sawmill'/>

    <enum-item name='engineering_machine_chariot_odometer'/>
    <enum-item name='engineering_machine_chain_drive'/>
    <enum-item name='engineering_machine_mechanical_compass'/>
    <enum-item name='engineering_machine_differential_gear'/>
    <enum-item name='engineering_machine_combination_lock'/>
    <enum-item name='engineering_machine_verge_escapement'/>
    <enum-item name='engineering_machine_balance_wheel'/>
    <enum-item name='engineering_fluid_theory_of_siphon'/>

    <enum-item name='engineering_fluid_valves' comment='416'/>
    <enum-item name='engineering_fluid_force_pump'/>
    <enum-item name='engineering_optics_crystal_lens'/>
    <enum-item name='engineering_optics_water_filled_spheres'/>
    <enum-item name='engineering_optics_glass_lens'/>
    <enum-item name='engineering_optics_camera_obscura'/>
    <enum-item name='engineering_optics_parabolic_mirror'/>
    <enum-item name='engineering_optics_theory_of_color'/>

    <enum-item name='engineering_optics_theory_of_rainbows'/>
    <enum-item name='engineering_optics_law_of_refraction'/>
    <enum-item name='engineering_design_models_and_templates'/>
    <enum-item name='engineering_construction_wood_lamination'/>
    <enum-item name='engineering_astronomy_dioptra'/>
    <enum-item name='engineering_astronomy_astrolabe'/>
    <enum-item name='engineering_astronomy_armillary_sphere'/>
    <enum-item name='engineering_astronomy_spherical_astrolabe'/>

    <enum-item name='engineering_astronomy_mural_instrument'/>
    <enum-item name='engineering_astronomy_orrery'/>
    <enum-item name='engineering_machine_water_powered_trip_hammer'/>
    <enum-item name='engineering_machine_double_acting_piston_bellows'/>
    <enum-item name='engineering_fluid_archimedes_principle'/>
    <enum-item name='engineering_optics_atmospheric_refraction'/>
    <enum-item name='engineering_optics_cause_of_twilight'/>
    <enum-item name='engineering_optics_height_of_atmosphere'/>

    <enum-item name='engineering_machine_piston'/>
    <enum-item name='engineering_machine_crank'/>
    <enum-item name='engineering_machine_bellows'/>
    <enum-item name='engineering_machine_water_powered_piston_bellows'/>
    <enum-item name='engineering_machine_water_wheel'/>
    <enum-item name='engineering_machine_trip_hammer'/>
    <enum-item/> Invalid Type
    <enum-item/> Invalid Type
</enum-type>

'''

lethosor commented 6 years ago

Oh, I didn't see your edits. Making new comments would make sure people get notifications. Anyway, I've wanted to support complex enums, since there a few others using a similar trick (but not as large as this one), so that's supported in dfhack/dfhack#1254 now.

PatrikLundell commented 6 years ago

Good job!