-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Print function arguments on single line
- Loading branch information
Showing
8 changed files
with
362 additions
and
319 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
function a() | ||
return 1, 2, 3, 4 | ||
end | ||
|
||
function a() | ||
return | ||
-- 1 | ||
1, -- 2 | ||
2, -- 3 | ||
-- 4 | ||
3, | ||
-- 5 | ||
4 -- 6 | ||
-- 7 | ||
end | ||
|
||
function a() | ||
return | ||
--[[8]] | ||
1, --[[9]] | ||
2, --[[10]] | ||
--[[11]] | ||
3, | ||
--[[12]] | ||
4 --[[13]] | ||
--[[14]] | ||
end | ||
|
||
function a() | ||
return | ||
--[[15]] | ||
1, --[[16]] | ||
2, --[[17]] | ||
--[[18]] | ||
function() print(3) return 4 end, | ||
--[[19]] | ||
4 --[[20]] | ||
--[[21]] | ||
end | ||
|
||
function a() | ||
return 1, 2, function() print(3) return 4 end, 4 | ||
end | ||
|
||
hook.Add("OnPrettyPrint", "test", function() | ||
-- yes | ||
a = 1 + 1 | ||
return function() | ||
-- fancy | ||
end | ||
-- no | ||
end) | ||
|
||
for b, c, d in 2, 3, function() | ||
-- A function in a for loop, is it possible? Syntactically, yes! | ||
-- And this comment makes it _really_ awkward to pretty print! | ||
end, 4, 5 do | ||
print(a, b, c, d) | ||
end | ||
|
||
for b, c, d in 2, 3, {"foo", "bar"}, 4, 5 do | ||
print(a, b, c, d) | ||
end | ||
|
||
for b, c, d in 2, 3, {a = "foo", b = "bar"}, 4, 5 do | ||
print(a, b, c, d) | ||
end |
Oops, something went wrong.