-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
lexers/j/jasmin.go
Outdated
result += 0.6 | ||
} | ||
|
||
return float32(math.Min(result, float64(1.0))) |
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.
Returning a number > 1 might not do any harm. Maybe it is even intended here?
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.
We don't know. Let's see what happens with PR I submitted and if we don't get any response I'll change back to the original logic.
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.
Ok, let's wait for the pygments PR. But I would suggest to use our general approach for cases of uncertainties and stick to logic of wakatime python client for now.
We cannot go wrong with having the old pygments logic here, because this is what's currently in use in the wakatime python client. And I could imagine, that the pygments PR will hang for some time.
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.
Agreed and already reverted the usage of min()
to the python's logic. Also I'll follow up the PR I submitted to Pygments.
c3cebca
to
1658a92
Compare
@dron22 rebased done. |
1658a92
to
6e7303f
Compare
6e7303f
to
14fb522
Compare
14fb522
to
086da6a
Compare
This PR ports pygments Jasmin text analysis to chroma/go. Original code can be found at: https://github.com/pygments/pygments/blob/master/pygments/lexers/jvm.py#L1608
Also I found useful to make sure the result never gets higer than 1.0 and added
Min
to it. Also the same implementation has been done for GDScript. I already opned a PR for Pygments.