(position int, sourceFile *ast.SourceFile)
| 76 | } |
| 77 | |
| 78 | func GetLineStartPositionForPosition(position int, sourceFile *ast.SourceFile) int { |
| 79 | lineStarts := scanner.GetECMALineStarts(sourceFile) |
| 80 | line := scanner.GetECMALineOfPosition(sourceFile, position) |
| 81 | return int(lineStarts[line]) |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * Tests whether `child` is a grammar error on `parent`. |