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

Method visitAssignStatement

packages/cashc/src/ast/AstBuilder.ts:211–219  ·  view source on GitHub ↗
(ctx: AssignStatementContext)

Source from the content-addressed store, hash-verified

209 }
210
211 visitAssignStatement(ctx: AssignStatementContext): AssignNode {
212 const identifier = new IdentifierNode(ctx.Identifier().getText());
213 identifier.location = Location.fromToken(ctx.Identifier().symbol);
214
215 const expression = this.createAssignExpression(ctx);
216 const assign = new AssignNode(identifier, expression);
217 assign.location = Location.fromCtx(ctx);
218 return assign;
219 }
220
221 // Builds the right-hand side expression for an assignStatement, rewriting compound
222 // forms (+=, -=, ++, --) as: identifier (+|-) rhs

Callers 1

acceptMethod · 0.80

Calls 4

fromTokenMethod · 0.80
fromCtxMethod · 0.80
IdentifierMethod · 0.45

Tested by

no test coverage detected