Conversation
d320220 to
519076c
Compare
PR Check ResultsEcosystem✅ ecosystem check detected no changes. BenchmarkLinuxWindows |
MichaReiser
left a comment
There was a problem hiding this comment.
The jaccard index on django afterwards is 0.915.
What was the value before?
I think it could make sense to give it a quick try to add the if and else tokens to the SimpleTokenizer.
| /// Looks for a multi char token in the range that contains no other tokens. `SimpleTokenizer` only | ||
| /// works with single char tokens so we check that we have the right token by string comparison. |
There was a problem hiding this comment.
It should be possible to add support for if and else. Comments are already non-single token strings.
The backwards lexing is a bit more annoying but should be doable as well.
There was a problem hiding this comment.
i didn't want to change the single-char-ness of the tokenizer just for this PR, but if you want i can do the refactoring in another PR
|
|
||
| if if_token.range.start() < comment.slice().start() | ||
| && comment.slice().start() < test.start() | ||
| && comment.line_position().is_end_of_line() |
There was a problem hiding this comment.
I recommend moving the line_position check to the very top to avoid unnecessarily lexing own line comments.
The order for ternary operators is different than that for if statements
0.911, added it to the description |
1b825b5 to
730ebd7
Compare
I add it to my TODO list |
ooh, maybe i hadn't looked in detail but didn't consider it since it only has "special" chars so far, no words |
i took a stab at it: #5610 |
Summary
Format
ExprIfExp, also known as the ternary operator or inlineif. It can look likebut also
This also fixes a visitor order bug.
The jaccard index on django goes from 0.911 to 0.915.
Test Plan
I added fixtures without and with comments in strange places.