# Check new commands' compatibility with old ones.
|
# Note, a command can be added to V1 at any time, it's ok if a
|
# new command has no corresponding old command.
|
old_commands = {}
|
for each file old_file in old_dir:
|
old_idl := idl.parser.parse(old_file)
|
if any commands in old_idl have non-empty api_version != "1":
|
# We're not ready to handle future API versions yet.
|
print error and quit
|
|
for each command old_cmd in old_idl:
|
if old_cmd.api_version == "":
|
continue
|
|
assert old_cmd.command_name not in old_commands
|
old_commands.add(old_cmd.command_name)
|
|
new_cmd := new_commands[old_cmd.command_name]
|
assert new_cmd is not null # Can't remove a command from V1
|