MCPcopy
hub / github.com/pelletier/go-toml / Shape

Method Shape

unstable/parser.go:145–151  ·  view source on GitHub ↗

Shape returns the shape of the given range in the input. Will panic if the range is not a subslice of the input.

(r Range)

Source from the content-addressed store, hash-verified

143// Shape returns the shape of the given range in the input. Will
144// panic if the range is not a subslice of the input.
145func (p *Parser) Shape(r Range) Shape {
146 raw := p.Raw(r)
147 return Shape{
148 Start: p.position(int(r.Offset)),
149 End: p.position(int(r.Offset) + len(raw)),
150 }
151}
152
153// Expression returns a pointer to the node representing the last successfully
154// parsed expression.

Callers 3

ExampleParser_commentsFunction · 0.95
TestParserErrorPositionFunction · 0.95

Calls 2

RawMethod · 0.95
positionMethod · 0.95

Tested by 3

ExampleParser_commentsFunction · 0.76
TestParserErrorPositionFunction · 0.76