Adds __str__() method to ast classes that writes back VOLT data. Tries
to replicate VOLT syntax idiosyncrasies as much as possible for better
round-trip conversion.
This is a followup to commit 94633e9f46975c356ec3a2d21ed30768c2fa0cd5,
where I mistakenly made it return an Enum but parse_coverage_() it not
used only for ENUMs and in many (most?) places returning an Enum is
wrong as you have a list of separate items that has to rmain separate.
PROCESS_MARKS followed by a group name is used for markAttachmentType
lookup flag, while followed by MARK_GLYPH_SET is used for
useMarkFilteringSet. The code parsed both correctly but did not
distinguish between the two in the generated AST as it should since they
compile to different lookup flags.
* Fix ast.GroupDefinition.glyphSet() by using ast.GlyphName,
ast.GroupName and ast.Range in Parser.parse_coverage_(), and making it return
ast.Enum.
* Add ast.Enum.__len_() to fix the calculation of max_src and max_dest
in Parser.parse_substitution_(). I’m not sure I understand the logic
of this many to many check, will double check later.
* Update the test suite to reflect this. Had to add ast.Enum.__eq__() to
make it less painful, and __hash__() as otherwise ast.Enum wouldn’t be
used as a key in dicts (not sure this is a goo idea either, will
double check later).
The parser was still trying to read the next token even when the current
token was END, but I think it should just stop reading here. When
reading from TSIV table there can be null bytes at the end when would
cause an exception in the lexer.
When checking for duplicate anchors, the component number should be
taken into account since the same anchors can be used for different
components i.e. over ligatures.