This would make parts of the code more readable (the patterns itself) and remove those order dependent list() statements.
The numeric subpattern and list() export is somewhat error prone; the are in two different places. If the order ever happens to change, the list statement will also need updating. But if you accidentally miss one of them, that list statement breaks on the offset change position, which might go unnoticed if a test doesn't use that attribute on some very specific tag.
This would make parts of the code more readable (the patterns itself) and remove those order dependent list() statements.
The numeric subpattern and list() export is somewhat error prone; the are in two different places. If the order ever happens to change, the list statement will also need updating. But if you accidentally miss one of them, that list statement breaks on the offset change position, which might go unnoticed if a test doesn't use that attribute on some very specific tag.