Adding nameparser configuration entry.#110
Open
nicolasnoble wants to merge 1 commit intolunarmodules:masterfrom
Open
Adding nameparser configuration entry.#110nicolasnoble wants to merge 1 commit intolunarmodules:masterfrom
nameparser configuration entry.#110nicolasnoble wants to merge 1 commit intolunarmodules:masterfrom
Conversation
hishamhm
reviewed
Mar 4, 2024
| --- Provides a function to parse filenames. | ||
| -- This function is used to parse filenames in the debug hook. | ||
| -- It is passed the filename as an argument and should return the parsed filename. | ||
| -- The default parser removes leading `@` and replaces path separators with `/`. |
Member
There was a problem hiding this comment.
The description here doesn't really match the behavior in the code below:
- in the code below, the @-stripping parser still takes precedence over the user's custom nameparser whenever a name starts with @, meaning that it is not only a "default" behavior that can be overridden with nameparser, but instead nameparser is just a fallback
- the slash-conversion behavior happens after the namesparser as well.
I think a less surprising behavior would be:
- priority order to be that the nameparser takes precedence over the @-stripping (that is, match what's implied in the docs when it calls the @-stripping the "default")
- slash-conversion can remain after nameparser entries for simplicity (that is, match what is in the code), but that needs to be documented
Member
|
@nicolasnoble Thank you for the PR! Left you a review comment. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When embedding Lua into binary, it isn't uncommon to also package Lua files into the final product. There will usually be a custom loader to read the source files from the packaged files.
In order to maintain functionality of luacov in such circumstances, this PR provides a mechanism for the user to provide custom mappings between internal names and an external source location.
For example, if the custom file loader prefixes its files with
src:, we can do something like the following: