Skip to content

Commit

Permalink
Add aliases to parser (#2444)
Browse files Browse the repository at this point in the history
* Fix parser indentation

* Fix  parser comments

* Add aliases to parser

* Regenerate parser output

* Fix parser handling of multiple fields on one line

* Regenerate parser output

* Fix parser code style
  • Loading branch information
lazaray committed May 1, 2022
1 parent 666aa44 commit 6f044c5
Show file tree
Hide file tree
Showing 5 changed files with 531 additions and 92 deletions.
109 changes: 98 additions & 11 deletions parser/raylib_api.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,82 @@
"fields": [
{
"type": "float",
"name": "m0, m4, m8, m12",
"name": "m0",
"description": "Matrix first row (4 components)"
},
{
"type": "float",
"name": "m1, m5, m9, m13",
"name": "m4",
"description": "Matrix first row (4 components)"
},
{
"type": "float",
"name": "m8",
"description": "Matrix first row (4 components)"
},
{
"type": "float",
"name": "m12",
"description": "Matrix first row (4 components)"
},
{
"type": "float",
"name": "m1",
"description": "Matrix second row (4 components)"
},
{
"type": "float",
"name": "m5",
"description": "Matrix second row (4 components)"
},
{
"type": "float",
"name": "m2, m6, m10, m14",
"name": "m9",
"description": "Matrix second row (4 components)"
},
{
"type": "float",
"name": "m13",
"description": "Matrix second row (4 components)"
},
{
"type": "float",
"name": "m2",
"description": "Matrix third row (4 components)"
},
{
"type": "float",
"name": "m6",
"description": "Matrix third row (4 components)"
},
{
"type": "float",
"name": "m10",
"description": "Matrix third row (4 components)"
},
{
"type": "float",
"name": "m14",
"description": "Matrix third row (4 components)"
},
{
"type": "float",
"name": "m3, m7, m11, m15",
"name": "m3",
"description": "Matrix fourth row (4 components)"
},
{
"type": "float",
"name": "m7",
"description": "Matrix fourth row (4 components)"
},
{
"type": "float",
"name": "m11",
"description": "Matrix fourth row (4 components)"
},
{
"type": "float",
"name": "m15",
"description": "Matrix fourth row (4 components)"
}
]
Expand Down Expand Up @@ -907,6 +967,33 @@
]
}
],
"aliases": [
{
"type": "Vector4",
"name": "Quaternion",
"description": "Quaternion, 4 components (Vector4 alias)"
},
{
"type": "Texture",
"name": "Texture2D",
"description": "Texture2D, same as Texture"
},
{
"type": "Texture",
"name": "TextureCubemap",
"description": "TextureCubemap, same as Texture"
},
{
"type": "RenderTexture",
"name": "RenderTexture2D",
"description": "RenderTexture2D, same as RenderTexture"
},
{
"type": "Camera3D",
"name": "Camera",
"description": "Camera type fallback, defaults to Camera3D"
}
],
"enums": [
{
"name": "ConfigFlags",
Expand Down Expand Up @@ -4101,11 +4188,11 @@
},
{
"type": "int",
"name": "dataLength"
"name": "dataSize"
},
{
"type": "int *",
"name": "compDataLength"
"name": "compDataSize"
}
]
},
Expand All @@ -4120,11 +4207,11 @@
},
{
"type": "int",
"name": "compDataLength"
"name": "compDataSize"
},
{
"type": "int *",
"name": "dataLength"
"name": "dataSize"
}
]
},
Expand All @@ -4139,11 +4226,11 @@
},
{
"type": "int",
"name": "dataLength"
"name": "dataSize"
},
{
"type": "int *",
"name": "outputLength"
"name": "outputSize"
}
]
},
Expand All @@ -4158,7 +4245,7 @@
},
{
"type": "int *",
"name": "outputLength"
"name": "outputSize"
}
]
},
Expand Down
109 changes: 98 additions & 11 deletions parser/raylib_api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,82 @@ return {
fields = {
{
type = "float",
name = "m0, m4, m8, m12",
name = "m0",
description = "Matrix first row (4 components)"
},
{
type = "float",
name = "m1, m5, m9, m13",
name = "m4",
description = "Matrix first row (4 components)"
},
{
type = "float",
name = "m8",
description = "Matrix first row (4 components)"
},
{
type = "float",
name = "m12",
description = "Matrix first row (4 components)"
},
{
type = "float",
name = "m1",
description = "Matrix second row (4 components)"
},
{
type = "float",
name = "m5",
description = "Matrix second row (4 components)"
},
{
type = "float",
name = "m2, m6, m10, m14",
name = "m9",
description = "Matrix second row (4 components)"
},
{
type = "float",
name = "m13",
description = "Matrix second row (4 components)"
},
{
type = "float",
name = "m2",
description = "Matrix third row (4 components)"
},
{
type = "float",
name = "m3, m7, m11, m15",
name = "m6",
description = "Matrix third row (4 components)"
},
{
type = "float",
name = "m10",
description = "Matrix third row (4 components)"
},
{
type = "float",
name = "m14",
description = "Matrix third row (4 components)"
},
{
type = "float",
name = "m3",
description = "Matrix fourth row (4 components)"
},
{
type = "float",
name = "m7",
description = "Matrix fourth row (4 components)"
},
{
type = "float",
name = "m11",
description = "Matrix fourth row (4 components)"
},
{
type = "float",
name = "m15",
description = "Matrix fourth row (4 components)"
}
}
Expand Down Expand Up @@ -907,6 +967,33 @@ return {
}
}
},
aliases = {
{
type = "Vector4",
name = "Quaternion",
description = "Quaternion, 4 components (Vector4 alias)"
},
{
type = "Texture",
name = "Texture2D",
description = "Texture2D, same as Texture"
},
{
type = "Texture",
name = "TextureCubemap",
description = "TextureCubemap, same as Texture"
},
{
type = "RenderTexture",
name = "RenderTexture2D",
description = "RenderTexture2D, same as RenderTexture"
},
{
type = "Camera3D",
name = "Camera",
description = "Camera type fallback, defaults to Camera3D"
}
},
enums = {
{
name = "ConfigFlags",
Expand Down Expand Up @@ -3736,8 +3823,8 @@ return {
returnType = "unsigned char *",
params = {
{type = "const unsigned char *", name = "data"},
{type = "int", name = "dataLength"},
{type = "int *", name = "compDataLength"}
{type = "int", name = "dataSize"},
{type = "int *", name = "compDataSize"}
}
},
{
Expand All @@ -3746,8 +3833,8 @@ return {
returnType = "unsigned char *",
params = {
{type = "const unsigned char *", name = "compData"},
{type = "int", name = "compDataLength"},
{type = "int *", name = "dataLength"}
{type = "int", name = "compDataSize"},
{type = "int *", name = "dataSize"}
}
},
{
Expand All @@ -3756,8 +3843,8 @@ return {
returnType = "char *",
params = {
{type = "const unsigned char *", name = "data"},
{type = "int", name = "dataLength"},
{type = "int *", name = "outputLength"}
{type = "int", name = "dataSize"},
{type = "int *", name = "outputSize"}
}
},
{
Expand All @@ -3766,7 +3853,7 @@ return {
returnType = "unsigned char *",
params = {
{type = "const unsigned char *", name = "data"},
{type = "int *", name = "outputLength"}
{type = "int *", name = "outputSize"}
}
},
{
Expand Down
Loading

0 comments on commit 6f044c5

Please sign in to comment.