Skip to content

Commit d8ba75c

Browse files
committed
add parse-only flag to check
1 parent fc0ea92 commit d8ba75c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

nattlua/cli/init.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ config.commands["check"] = {
9797
description = "type check a nattlua or lua script",
9898
usage = "nattlua check <file>",
9999
options = {
100+
{name = "parse-only", description = "Only parse the file, do not analyze"},
100101
{name = "profile", description = "Run with profiler"},
101102
{name = "error-only", description = "Only print errors, not warnings"},
102103
{name = "show-severity", description = "Show severity level for warnings"},
@@ -140,7 +141,11 @@ config.commands["check"] = {
140141
end
141142
end
142143

143-
assert(cmp:Analyze())
144+
if options["parse-only"] then
145+
assert(cmp:Parse())
146+
else
147+
assert(cmp:Analyze())
148+
end
144149
end
145150

146151
if options.profile then prof:Stop() end

0 commit comments

Comments
 (0)