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

Support Unicode character offsets #343

Merged
merged 4 commits into from
Jan 16, 2019
Merged

Support Unicode character offsets #343

merged 4 commits into from
Jan 16, 2019

Conversation

dennwc
Copy link
Member

@dennwc dennwc commented Jan 14, 2019

Currently, SDK only supports positional offset in bytes or line-column pair, where a column is given in bytes.

PR implements a new Positioner that converts Unicode character offsets to a byte offset and a line-column pair (in bytes as well).

Also, refactor long name for position functions to something shorter and place a deprecation note on the old ones.

This is change will allow to solve issues like bblfsh/javascript-driver#25.

Denys Smirnov added 2 commits January 14, 2019 17:42
Signed-off-by: Denys Smirnov <denys@sourced.tech>
Signed-off-by: Denys Smirnov <denys@sourced.tech>
@dennwc dennwc self-assigned this Jan 14, 2019
@dennwc dennwc changed the title Support Unicode charater offsets Support Unicode character offsets Jan 14, 2019
Signed-off-by: Denys Smirnov <denys@sourced.tech>
@juanjux
Copy link
Contributor

juanjux commented Jan 14, 2019

Nice!

uast/transformer/positioner/positions.go Outdated Show resolved Hide resolved
uast/transformer/positioner/positions.go Outdated Show resolved Hide resolved
uast/transformer/positioner/positions.go Outdated Show resolved Hide resolved
uast/transformer/positioner/positions.go Outdated Show resolved Hide resolved
Signed-off-by: Denys Smirnov <denys@sourced.tech>
@dennwc
Copy link
Member Author

dennwc commented Jan 16, 2019

@creachadair PTAL

@dennwc dennwc merged commit bc12100 into bblfsh:master Jan 16, 2019
@dennwc dennwc deleted the utf8_offs branch January 16, 2019 16:17
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.

3 participants