Added USD related queries and tests

This commit is contained in:
Colin Kennedy 2023-05-15 21:36:35 -07:00
parent f9247b41aa
commit a3c227e681
3 changed files with 42 additions and 10 deletions

View file

@ -4,29 +4,23 @@
(#set! "kind" "Class")
) @type
(prim_definition
(string) @name
(#offset! @name 0 1 0 -1)
(#set! "kind" "Class")
) @type
(attribute_assignment
(identifier) @name
[(identifier) (qualified_identifier)] @name
(#set! "kind" "Property")
) @type
(attribute_declaration
(identifier) @name
[(identifier) (qualified_identifier)] @name
(#set! "kind" "Property")
) @type
(relationship_assignment
(identifier) @name
[(identifier) (qualified_identifier)] @name
(#set! "kind" "Property")
) @type
(relationship_declaration
(identifier) @name
[(identifier) (qualified_identifier)] @name
(#set! "kind" "Property")
) @type

View file

@ -0,0 +1,17 @@
local util = require("tests.test_util")
describe("treesitter USD", function()
it("parses all symbols correctly", function()
util.test_file_symbols("treesitter", "./tests/treesitter/usd_test.usd", {
{
kind = "Class",
name = "something",
level = 0,
lnum = 3,
col = 0,
end_lnum = 4,
end_col = 8,
},
})
end)
end)

View file

@ -0,0 +1,21 @@
#usda 1.0
def Xform "something" (
kind = "component"
)
{
def Xform "child"
{
float3 foo:xformOp:rotateXYZ = (-15.7, -55.8, 0.3)
double3 translate = (153.2, 119.3, 24.7)
uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ"]
variantSet "variants" = {
"default" {
}
"one" {
double3 xformOp:translate = (10, 10, 10)
}
}
}
}