Closed knudtty closed 1 month ago
Did you run the tests? I'm getting an error with this PR. There's also no test case to check the new behaviour.
I've updated the PR to the test case you provided in the issue, and the first commit in this PR.
Thanks!
Fixes #870
When looking into the internal go/scanner package, I found the final comments are skipped. It works by scanning til the end of a comment, then a goto to the beginning of the Scan function if the mode is not set to ScanComments. If the scanner encounters the final closing brace, the position returned has not advanced.
I implemented a solution that scans comments and advances the length of the token literal. While writing this description I realized the
end
variable in the go expression extractor probably just needs to be updated properly. Essentially I have implemented 2 fixes. Please review both (small) commits, in case one is a better solution than the other.