Skip to content
This repository was archived by the owner on Nov 10, 2018. It is now read-only.

API diff format

Anaminus edited this page Apr 14, 2014 · 8 revisions

DiffAPI is used to get the differences between two API dumps. The returned table is a list of differences, each represented as an array:

 { diffType, subType, apiItem, ... }
  • diffType is a number indicating the type of difference. This can be -1 (Removal), 0 (Change), or 1 (Addition).
  • subType is a string that indicates the difference more precisely. It determines the values that follow.
  • apiItem is an item struct from the API dump (see API dump format), which is related to the difference.
The following table displays the possible values of subType, as well as the values that come after it.
Subtype API item type Additional values
Removals
Item (any) (none; entire item was removed)
Class Class A list of members belonging to the class, which were also removed.
Enum Enum A list of EnumItem items belonging to the enum, which were also removed.
Tag (any) The name of the tag.
Additions
Item (any) (none; entire item was added)
Class Class A list of members belonging to the class, which were also added.
Enum Enum A list of EnumItem items belonging to the enum, which were also added.
Tag (any) The name of the tag.
Changes
Superclass Class The new superclass.
ValueType Property The new value type.
ReturnType Function, YieldFunction, Callback The new return type.
Arguments Function, Event, YieldFunction, Callback The new list of arguments.
Value EnumItem The new enum item value.
Security (any) Two values: the old tag, and the new tag. Either (but not both) of these values may be nil, which can be interpreted as no security.

Argument diffs

As of April 14, 2014, argument diffs are not used in the latest version. They have been replaced with a list of the new arguments.

The way the arguments of a function have changed can be described with a list of argument diffs. Somewhat similar to API diffs, these are also arrays. The first value is a number that describes the type of change. This indicates the next values in the array.

Number Description Values
1 Insert
  1. The position where the argument has been inserted.
  2. An argument struct representing the new argument.
2 Remove
  1. The position of the removed argument.
3 Swap
  1. The position of the first swapped argument
  2. The position of the second swapped argument.
4 Replace
  1. The position of the replaced argument.
  2. An argument struct that replaces the argument.

Each diff is incremental. That is, they are steps that are applied to the list of arguments one after the other, in order.

Summary

APIDiff:
{ -1, "Item"      , APIItem,                    }
{ -1, "Class"     , APIClass,    []APIItem      }
{ -1, "Enum"      , APIEnum,     []APIItem      }
{ -1, "Tag"       , APIItem,     string         }
{  0, "Superclass", APIClass,    string         }
{  0, "ValueType" , APIProperty, string         }
{  0, "ReturnType", APIFunction, string         }
{  0, "Arguments" , APIFunction, []APIArgument  }
{  0, "Value"     , APIEnumItem, int            }
{  0, "Security"  , APIItem,     string, string }
{  1, "Item"      , APIItem,                    }
{  1, "Class"     , APIClass,    []APIItem      }
{  1, "Enum"      , APIEnum,     []APIItem      }
{  1, "Tag"       , APIItem,     string         }

Clone this wiki locally