-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve tracking of InstallMethod and DeclareOperation #2422
Improve tracking of InstallMethod and DeclareOperation #2422
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2422 +/- ##
==========================================
+ Coverage 73.88% 73.89% +<.01%
==========================================
Files 484 484
Lines 245465 245477 +12
==========================================
+ Hits 181371 181383 +12
Misses 64094 64094
|
I don't have strong feelings about LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am happy with the solution to access the first line of a method installation.
Since now the first and the last line of a method installation are in principle available, would it make sense to store both values?
6721469
to
12ccbdd
Compare
@ThomasBreuer good point; I changed it to now store a triple |
12ccbdd
to
b767782
Compare
So far, we used `INPUT_LINENUMBER()` to record the location of an InstallMethod or DeclareOperation call. But in case such a call takes multiple lines, that points to the *last* line, while we would prefer if it pointed to the *first* line. To achieve that, we add a new global variable `READEVALCOMMAND_LINENUMBER` which is updated at the start of `ReadEvalCommand`.
So far, we used
INPUT_LINENUMBER()
to record the location of anInstallMethod
orDeclareOperation
call. But in case such a call takes multiple lines, that points to the last line, while we would prefer if it pointed to the first line. To achieve that, we add a new global variableREADEVALCOMMAND_LINENUMBER
which is updated at the start ofReadEvalCommand
.One may debate whether it might be better if
READEVALCOMMAND_LINENUMBER
was a global function which returns the desired result. If somebody has a good argument for that, I'll be happy to adapt the patch. The only reason I used a global variable is that it was the quickest way to implement this.