diff --git a/README.md b/README.md index f3d38bf..11c1a61 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # TI Toolkit Token Sheets -Here you can find token sheets for the TI-73 and TI-83/84-series calculators to include in external projects. The sheets contain detailed information about every token in a simple XML format. Basic scripts for parsing the sheets are also included. +Here you can find token sheets for the TI-83/84-series calculators to include in external projects. The sheets contain detailed information about every token in a simple XML format. Basic scripts for parsing the sheets are also included. ## How to Use @@ -10,7 +10,7 @@ You can also manually include a download of the sheets and/or scripts as needed. ## XML Format -The XML format for `8X.xml` is outlined below; `73.xml` follows a similar schema. +The XML format for `8X.xml` is outlined below. #### Tokens diff --git a/scripts/formats.py b/scripts/formats.py index a6cb73e..9086306 100644 --- a/scripts/formats.py +++ b/scripts/formats.py @@ -7,7 +7,7 @@ from .parse import OsVersion, OsVersions -def validate(root: ET.Element, *) -> int: +def validate(root: ET.Element) -> int: """ Validates a token sheet, raising an error if an invalid component is found @@ -82,6 +82,11 @@ def text(regex: str): children(r"()?()+") case "since": + if (this_version := OsVersion.from_element(element)) < version: + raise ValidationError(f"version {this_version} overlaps with {version}") + + version = this_version + # Workaround for nested defaultdict all_names[version] = all_names.get(version, defaultdict(set))