(sourceFile *ast.SourceFile, line int)
| 2701 | } |
| 2702 | |
| 2703 | func GetECMAEndLinePosition(sourceFile *ast.SourceFile, line int) int { |
| 2704 | pos := int(GetECMALineStarts(sourceFile)[line]) |
| 2705 | for { |
| 2706 | ch, size := utf8.DecodeRuneInString(sourceFile.Text()[pos:]) |
| 2707 | if size == 0 || stringutil.IsLineBreak(ch) { |
| 2708 | return pos - 1 |
| 2709 | } |
| 2710 | pos += size |
| 2711 | } |
| 2712 | } |
| 2713 | |
| 2714 | // GetECMAPositionOfLineAndUTF16Character converts a 0-based line number and UTF-16 |
| 2715 | // code unit character offset back to an absolute byte position in the source text. |
no test coverage detected