MCPcopy Create free account
hub / github.com/CashScript/cashscript / fromToken

Method fromToken

packages/cashc/src/ast/Location.ts:17–24  ·  view source on GitHub ↗
(token: Token)

Source from the content-addressed store, hash-verified

15 }
16
17 static fromToken(token: Token): Location {
18 const textLength = (token.text ?? '').length;
19
20 const start = new Point(token.line, token.column);
21 const end = new Point(token.line, token.column + textLength);
22
23 return new Location(start, end);
24 }
25
26 static fromObject(object: LocationI): Location {
27 const start = new Point(object.start.line, object.start.column);

Callers 5

getTokenLocationFunction · 0.80
visitAssignStatementMethod · 0.80
visitFunctionCallMethod · 0.80
visitInstantiationMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected