Skip to content
This repository has been archived by the owner on Aug 7, 2019. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Support negative positions in tokenizer
  • Loading branch information
vmarkovtsev committed Sep 22, 2017
1 parent 57bdc9b commit 7665f22
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 0 deletions.
Binary file modified bin/tokenizer_darwin
Binary file not shown.
Binary file modified bin/tokenizer_linux
Binary file not shown.
Binary file modified bin/tokenizer_win32.exe
Binary file not shown.
3 changes: 3 additions & 0 deletions tokenizer/tokenize/tokenize.go
Expand Up @@ -11,6 +11,9 @@ import (

func TokenizeScope(content []byte, pos int, full bool) TokenList {
if len(content) >= pos {
if pos < 0 {
pos += len(content)
}
contentSoFar := string(content[:pos])
idx := strings.LastIndex(contentSoFar, "\nfunc ")
if idx >= 0 {
Expand Down

0 comments on commit 7665f22

Please sign in to comment.