fix(spec): ASTs need to have `dependencies`
ci/woodpecker/pr/docker-build Pipeline was successful Details
ci/woodpecker/pr/lint Pipeline was successful Details
ci/woodpecker/pr/build Pipeline was successful Details
ci/woodpecker/pr/test Pipeline was successful Details

This commit is contained in:
Aire-One 2023-07-18 20:25:01 +02:00
parent 6c34facd41
commit eec274af44
2 changed files with 6 additions and 2 deletions

View File

@ -21,6 +21,7 @@ describe("Teal type definition Printer", function()
it("should print a simple module type definition", gen( it("should print a simple module type definition", gen(
{ {
children = {}, children = {},
dependencies = {},
name = "Empty", name = "Empty",
token = "module", token = "module",
}, },
@ -51,6 +52,7 @@ describe("Teal type definition Printer", function()
token = "enum", token = "enum",
}, },
}, },
dependencies = {},
name = "Signal_Module", name = "Signal_Module",
token = "module", token = "module",
}, },
@ -76,6 +78,7 @@ describe("Teal type definition Printer", function()
token = "variable", token = "variable",
} }
}, },
dependencies = {},
name = "Property_Module", name = "Property_Module",
token = "module", token = "module",
}, },
@ -110,6 +113,7 @@ describe("Teal type definition Printer", function()
token = "function", token = "function",
}, },
}, },
dependencies = {},
name = "Function_Module", name = "Function_Module",
token = "module", token = "module",
}, },
@ -132,6 +136,7 @@ describe("Teal type definition Printer", function()
token = "record", token = "record",
} }
}, },
dependencies = {},
name = "Nested_Module", name = "Nested_Module",
token = "module", token = "module",
}, },

View File

@ -54,10 +54,9 @@ local node_printer <total>: { Node.Token : Node_Printer_Function } = {
[[ [[
-- This file was auto-generated. -- This file was auto-generated.
%s %s
local record %s local record %s
]], ]],
render_require(node.dependencies), render_require(node.dependencies), -- last require statement will have a newline
node.name), node.name),
indent_level), indent_level + 1 indent_level), indent_level + 1
end, end,