Roland Melkert Wrote:The type meta can be a pain to parse indeed.
This is what I'm using at the moment:
Code:meta: "LDRAW", "LDRAWORG", "LDRAW_ORG", "!LDRAW_ORG", "OFFICIAL", "UNOFFICIAL", "UN-OFFICIAL",
type: "Part", "Subpart", "Primitive", "48_Primitive", "Shortcut", "File", "Model", "Submodel", "Element", "Sub-part", "Hi-Res primitive", "Alias", "Cross-reference", "Configuration", "Unofficial_Primitive", "Unofficial_Part", "Unofficial_Model"
qualifier: "Physical_Colour", "Alias"
All case insensitive, and do note the space in "Hi-Res primitive" you need to keep an eye on that while parsing.
You also need to skip an optional "LCAD" after the main meta keyword.
Hope it helps.
I am confused as to why you need to cater for all that non-standard syntax. The header spec (with addenda) is pretty clear, that all that is allowed in Parts is:
Code:
meta: "!LDRAW_ORG"
type: "Part", "Subpart", "Primitive", "48_Primitive", "Shortcut", "Unofficial_Part", "Unofficial_Subpart", "Unofficial_Primitive", "Unofficial_48_Primitive", "Unofficial_Shortcut"
qualifier: "Physical_Colour", "Alias"
version: "ORIGINAL", "UPDATE yyyy-rr"
Every official part since the library was re-issued as 2008-01, adheres to this.
Is the real complaint that lack of checking of unofficial parts submitted to the Parts Tracker? As mentioned here, the submit process could use the header checking routine that is run prior to parts release. I'd appreciate more than one person's feedback on whether the rejection of submissions due to malformed headers would be a barrier to contributors.
Chris (LDraw Parts Library Admin)