JavaScript: Fix bug in extraction of `next_token`.

This commit is contained in:
Max Schaefer 2019-01-29 12:58:32 +00:00
Родитель ea429f4fbe
Коммит d6c3ae2fb4
3 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -133,7 +133,7 @@ public class LexicalExtractor {
locationManager.emitNodeLocation(token, key);
// fill in next_token relation
while (j < comments.size() && comments.get(j).getLoc().getEnd().compareTo(token.getLoc().getStart()) < 0)
while (j < comments.size() && comments.get(j).getLoc().getEnd().compareTo(token.getLoc().getStart()) <= 0)
trapwriter.addTuple("next_token", this.trapwriter.localID(comments.get(j++)), key);
// the parser sometimes duplicates tokens; skip the second one by nulling it out

Просмотреть файл

@ -41,7 +41,7 @@ public class Main {
* such a way that it may produce different tuples for the same file under the same
* {@link ExtractorConfig}.
*/
public static final String EXTRACTOR_VERSION = "2019-01-17";
public static final String EXTRACTOR_VERSION = "2019-01-29";
public static final Pattern NEWLINE = Pattern.compile("\n");

Просмотреть файл

@ -3,5 +3,5 @@
| comments.js:3:7:3:29 | <!-- HT ... t start | comments.js:7:10:7:17 | function |
| comments.js:4:1:4:18 | /** doc comment */ | comments.js:7:10:7:17 | function |
| comments.js:5:1:5:20 | --> HTML comment end | comments.js:7:10:7:17 | function |
| comments.js:7:1:7:9 | /*start*/ | comments.js:7:19:7:19 | f |
| comments.js:7:24:7:30 | /*end*/ | comments.js:8:1:8:0 | |
| comments.js:7:1:7:9 | /*start*/ | comments.js:7:10:7:17 | function |
| comments.js:7:24:7:30 | /*end*/ | comments.js:7:31:7:31 | } |