-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend GCproto debug with declared function name (declname)
Lua functions can be declared in many different ways: function () end function foo () end function foo.bar () end function foo.bar:baz() end local function foo.bar:baz() end This change captures the text between 'function' and '(' as the "declared name" (declname) and records this in the GCproto object's debug information. This makes it possible to recover the declared name of a function, such as "foo.bar:baz", from its prototype. The Lua approach is usually to resolve names at runtime using introspection to see what name a function is bound to. However we need a mechanism that works on the "cold" debug information in the audit.log. One consequence is that semantically equivalent function declarations will have different levels of debug information in practice: fun = function () end -- Has no declname function fun () end -- Has declname "fun" which might penalize certain legitimate programming styles. That is lamentable. The situation is similar to the Scheme world: (define fun (lamdba ())) ; Function object has no debug name (define (fun)) ; Function object has debug name "fun"
- Loading branch information
Showing
6 changed files
with
80 additions
and
17 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
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
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