spudplate
Template scaffolding compiler for spudlang .spud files
Loading...
Searching...
No Matches
spudplate::AssignStmt Struct Reference

A bare assignment statement - rebinds an existing variable. More...

#include <ast.h>

Public Attributes

std::string name
 Variable name to rebind.
 
ExprPtr value
 Expression whose value replaces the current binding.
 
int line
 1-based source line where this node begins.
 
int column
 1-based source column where this node begins.
 

Detailed Description

A bare assignment statement - rebinds an existing variable.

Example: count = count + 1

Unlike let, the name must already be declared in an enclosing scope and the new value must match the original type. Path aliases bound by as, repeat iterators, and ask-bound names are read-only and may not be reassigned.