Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

Conversation

@juanjux
Copy link
Contributor

@juanjux juanjux commented Sep 28, 2017

Fixes #102.

Will be rebased after #101 is merged.

@juanjux juanjux self-assigned this Sep 28, 2017
@juanjux juanjux requested a review from abeaumont September 28, 2017 13:18

if node_column is None or node_column != token_startcolumn:
token_startcolumn = token[TOKEN_STARTLOC][TOKENCOL]
if nodedict.get('col_offset') != token_startcolumn:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be if nodedict.get('col_offset') != token_startcolumn + add: ?
If so, I don't see the point of checking the values, wouldn't it just be simpler with:

nodedict['lineno'] = token[TOKEN_STARTLOC][TOKENROW]
nodedict['col_offset'] = token[TOKEN_STARTLOC][TOKENCOL] + add

Also note that there's no consistency in strins. and both single and double quoted strings are used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, the "if" was a vestige of when this code was in pydetector, I've also removed the "add" parameter that was optional an unused (another vestige).

@juanjux juanjux changed the title [Not for Merge] Fix starting line number of multi-line nodes with tokens Fix starting line number of multi-line nodes with tokens Oct 2, 2017
@juanjux juanjux merged commit 3b104f5 into bblfsh:master Oct 2, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants